Commit b3096c70 authored by Corey Minyard's avatar Corey Minyard

ipmi: Remove platform driver overrides and use the id_table

The IPMI DMI code was adding platform overrides, which is not
really an ideal solution.  Switch to using the id_table in
the drivers to identify the devices.
Signed-off-by: default avatarCorey Minyard <cminyard@mvista.com>
parent 36e398d7
...@@ -44,7 +44,7 @@ static void __init dmi_add_platform_ipmi(unsigned long base_addr, ...@@ -44,7 +44,7 @@ static void __init dmi_add_platform_ipmi(unsigned long base_addr,
unsigned int num_r = 1, size; unsigned int num_r = 1, size;
struct property_entry p[5]; struct property_entry p[5];
unsigned int pidx = 0; unsigned int pidx = 0;
char *name, *override; char *name;
int rv; int rv;
enum si_type si_type; enum si_type si_type;
struct ipmi_dmi_info *info; struct ipmi_dmi_info *info;
...@@ -52,11 +52,9 @@ static void __init dmi_add_platform_ipmi(unsigned long base_addr, ...@@ -52,11 +52,9 @@ static void __init dmi_add_platform_ipmi(unsigned long base_addr,
memset(p, 0, sizeof(p)); memset(p, 0, sizeof(p));
name = "dmi-ipmi-si"; name = "dmi-ipmi-si";
override = "ipmi_si";
switch (type) { switch (type) {
case IPMI_DMI_TYPE_SSIF: case IPMI_DMI_TYPE_SSIF:
name = "dmi-ipmi-ssif"; name = "dmi-ipmi-ssif";
override = "ipmi_ssif";
offset = 1; offset = 1;
size = 1; size = 1;
si_type = SI_TYPE_INVALID; si_type = SI_TYPE_INVALID;
...@@ -101,10 +99,6 @@ static void __init dmi_add_platform_ipmi(unsigned long base_addr, ...@@ -101,10 +99,6 @@ static void __init dmi_add_platform_ipmi(unsigned long base_addr,
pr_err("Error allocation IPMI platform device\n"); pr_err("Error allocation IPMI platform device\n");
return; return;
} }
pdev->driver_override = kasprintf(GFP_KERNEL, "%s",
override);
if (!pdev->driver_override)
goto err;
if (type == IPMI_DMI_TYPE_SSIF) { if (type == IPMI_DMI_TYPE_SSIF) {
p[pidx++] = PROPERTY_ENTRY_U16("i2c-addr", base_addr); p[pidx++] = PROPERTY_ENTRY_U16("i2c-addr", base_addr);
......
...@@ -419,6 +419,11 @@ static int ipmi_remove(struct platform_device *pdev) ...@@ -419,6 +419,11 @@ static int ipmi_remove(struct platform_device *pdev)
return ipmi_si_remove_by_dev(&pdev->dev); return ipmi_si_remove_by_dev(&pdev->dev);
} }
static const struct platform_device_id si_plat_ids[] = {
{ "dmi-ipmi-si", 0 },
{ }
};
struct platform_driver ipmi_platform_driver = { struct platform_driver ipmi_platform_driver = {
.driver = { .driver = {
.name = DEVICE_NAME, .name = DEVICE_NAME,
...@@ -427,6 +432,7 @@ struct platform_driver ipmi_platform_driver = { ...@@ -427,6 +432,7 @@ struct platform_driver ipmi_platform_driver = {
}, },
.probe = ipmi_probe, .probe = ipmi_probe,
.remove = ipmi_remove, .remove = ipmi_remove,
.id_table = si_plat_ids
}; };
void ipmi_si_platform_init(void) void ipmi_si_platform_init(void)
......
...@@ -1844,12 +1844,18 @@ static int ssif_platform_remove(struct platform_device *dev) ...@@ -1844,12 +1844,18 @@ static int ssif_platform_remove(struct platform_device *dev)
return 0; return 0;
} }
static const struct platform_device_id ssif_plat_ids[] = {
{ "dmi-ipmi-ssif", 0 },
{ }
};
static struct platform_driver ipmi_driver = { static struct platform_driver ipmi_driver = {
.driver = { .driver = {
.name = DEVICE_NAME, .name = DEVICE_NAME,
}, },
.probe = ssif_platform_probe, .probe = ssif_platform_probe,
.remove = ssif_platform_remove, .remove = ssif_platform_remove,
.id_table = ssif_plat_ids
}; };
static int init_ipmi_ssif(void) static int init_ipmi_ssif(void)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment