Skip to content

Commit 90b2d4f

Browse files
committed
ipmi_si: Remove hacks for adding a dummy platform devices
All the IPMI address sources now supply a real device. This cheap hack is no longer necessary. Signed-off-by: Corey Minyard <[email protected]>
1 parent e17c657 commit 90b2d4f

File tree

1 file changed

+3
-42
lines changed

1 file changed

+3
-42
lines changed

drivers/char/ipmi/ipmi_si_intf.c

Lines changed: 3 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -229,15 +229,9 @@ struct smi_info {
229229
/* From the get device id response... */
230230
struct ipmi_device_id device_id;
231231

232-
/* Default driver model device. */
233-
struct platform_device *pdev;
234-
235232
/* Have we added the device group to the device? */
236233
bool dev_group_added;
237234

238-
/* Have we added the platform device? */
239-
bool pdev_registered;
240-
241235
/* Counters and things for the proc filesystem. */
242236
atomic_t stats[SI_NUM_STATS];
243237

@@ -1969,24 +1963,9 @@ static int try_smi_init(struct smi_info *new_smi)
19691963

19701964
/* Do this early so it's available for logs. */
19711965
if (!new_smi->io.dev) {
1972-
init_name = kasprintf(GFP_KERNEL, "ipmi_si.%d",
1973-
new_smi->si_num);
1974-
1975-
/*
1976-
* If we don't already have a device from something
1977-
* else (like PCI), then register a new one.
1978-
*/
1979-
new_smi->pdev = platform_device_alloc("ipmi_si",
1980-
new_smi->si_num);
1981-
if (!new_smi->pdev) {
1982-
pr_err("Unable to allocate platform device\n");
1983-
rv = -ENOMEM;
1984-
goto out_err;
1985-
}
1986-
new_smi->io.dev = &new_smi->pdev->dev;
1987-
new_smi->io.dev->driver = &ipmi_platform_driver.driver;
1988-
/* Nulled by device_add() */
1989-
new_smi->io.dev->init_name = init_name;
1966+
pr_err("IPMI interface added with no device\n");
1967+
rv = EIO;
1968+
goto out_err;
19901969
}
19911970

19921971
/* Allocate the state machine's data and initialize it. */
@@ -2059,17 +2038,6 @@ static int try_smi_init(struct smi_info *new_smi)
20592038
atomic_set(&new_smi->req_events, 1);
20602039
}
20612040

2062-
if (new_smi->pdev && !new_smi->pdev_registered) {
2063-
rv = platform_device_add(new_smi->pdev);
2064-
if (rv) {
2065-
dev_err(new_smi->io.dev,
2066-
"Unable to register system interface device: %d\n",
2067-
rv);
2068-
goto out_err;
2069-
}
2070-
new_smi->pdev_registered = true;
2071-
}
2072-
20732041
dev_set_drvdata(new_smi->io.dev, new_smi);
20742042
rv = device_add_group(new_smi->io.dev, &ipmi_si_dev_attr_group);
20752043
if (rv) {
@@ -2253,13 +2221,6 @@ static void cleanup_one_si(struct smi_info *smi_info)
22532221
if (smi_info->intf)
22542222
ipmi_unregister_smi(smi_info->intf);
22552223

2256-
if (smi_info->pdev) {
2257-
if (smi_info->pdev_registered)
2258-
platform_device_unregister(smi_info->pdev);
2259-
else
2260-
platform_device_put(smi_info->pdev);
2261-
}
2262-
22632224
kfree(smi_info);
22642225
}
22652226

0 commit comments

Comments
 (0)