提交 19879eef 编写于 作者: C Corey Minyard 提交者: Xie XiuQi

ipmi: Remove platform driver overrides and use the id_table

mainline inclusion
from mainline-4.20-rc1
commit b3096c70b3faf0b08d7d461f359eb4b0447dff8e
category: cleanup
Bugzilla: 10639
CVE: NA

----------------------------------------

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: NCorey Minyard <cminyard@mvista.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
Reviewed-by: NHanjun Guo <guohanjun@huawei.com>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 5352ae35
......@@ -41,7 +41,7 @@ static void __init dmi_add_platform_ipmi(unsigned long base_addr,
unsigned int num_r = 1, size;
struct property_entry p[5];
unsigned int pidx = 0;
char *name, *override;
char *name;
int rv;
enum si_type si_type;
struct ipmi_dmi_info *info;
......@@ -49,11 +49,9 @@ static void __init dmi_add_platform_ipmi(unsigned long base_addr,
memset(p, 0, sizeof(p));
name = "dmi-ipmi-si";
override = "ipmi_si";
switch (type) {
case IPMI_DMI_TYPE_SSIF:
name = "dmi-ipmi-ssif";
override = "ipmi_ssif";
offset = 1;
size = 1;
si_type = SI_TYPE_INVALID;
......@@ -98,10 +96,6 @@ static void __init dmi_add_platform_ipmi(unsigned long base_addr,
pr_err("ipmi:dmi: Error allocation IPMI platform device\n");
return;
}
pdev->driver_override = kasprintf(GFP_KERNEL, "%s",
override);
if (!pdev->driver_override)
goto err;
if (type == IPMI_DMI_TYPE_SSIF) {
p[pidx++] = PROPERTY_ENTRY_U16("i2c-addr", base_addr);
......
......@@ -417,6 +417,11 @@ static int ipmi_remove(struct platform_device *pdev)
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 = {
.driver = {
.name = DEVICE_NAME,
......@@ -425,6 +430,7 @@ struct platform_driver ipmi_platform_driver = {
},
.probe = ipmi_probe,
.remove = ipmi_remove,
.id_table = si_plat_ids
};
void ipmi_si_platform_init(void)
......
......@@ -1858,12 +1858,18 @@ static int ssif_platform_remove(struct platform_device *dev)
return 0;
}
static const struct platform_device_id ssif_plat_ids[] = {
{ "dmi-ipmi-ssif", 0 },
{ }
};
static struct platform_driver ipmi_driver = {
.driver = {
.name = DEVICE_NAME,
},
.probe = ssif_platform_probe,
.remove = ssif_platform_remove,
.id_table = ssif_plat_ids
};
static int init_ipmi_ssif(void)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册