Skip to content

Commit 87875c1

Browse files
Uwe Kleine-Könighdeller
authored andcommitted
parisc: Make struct parisc_driver::remove() return void
The caller of this function (parisc_driver_remove() in arch/parisc/kernel/drivers.c) ignores the return value, so better don't return any value at all to not wake wrong expectations in driver authors. The only function that could return a non-zero value before was ipmi_parisc_remove() which returns the return value of ipmi_si_remove_by_dev(). Make this function return void, too, as for all other callers the value is ignored, too. Also fold in a small checkpatch fix for: WARNING: Unnecessary space before function pointer arguments + void (*remove) (struct parisc_device *dev); Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> (for drivers/input) Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com> Acked-by: Jiri Slaby <jirislaby@kernel.org> Signed-off-by: Helge Deller <deller@gmx.de>
1 parent d220da0 commit 87875c1

13 files changed

Lines changed: 17 additions & 30 deletions

File tree

arch/parisc/include/asm/parisc-device.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ struct parisc_driver {
3434
struct parisc_driver *next;
3535
char *name;
3636
const struct parisc_device_id *id_table;
37-
int (*probe) (struct parisc_device *dev); /* New device discovered */
38-
int (*remove) (struct parisc_device *dev);
37+
int (*probe)(struct parisc_device *dev); /* New device discovered */
38+
void (*remove)(struct parisc_device *dev);
3939
struct device_driver drv;
4040
};
4141

drivers/char/ipmi/ipmi_si.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ irqreturn_t ipmi_si_irq_handler(int irq, void *data);
7373
void ipmi_irq_start_cleanup(struct si_sm_io *io);
7474
int ipmi_std_irq_setup(struct si_sm_io *io);
7575
void ipmi_irq_finish_setup(struct si_sm_io *io);
76-
int ipmi_si_remove_by_dev(struct device *dev);
76+
void ipmi_si_remove_by_dev(struct device *dev);
7777
struct device *ipmi_si_remove_by_data(int addr_space, enum si_type si_type,
7878
unsigned long addr);
7979
void ipmi_hardcode_init(void);

drivers/char/ipmi/ipmi_si_intf.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2228,22 +2228,18 @@ static void cleanup_one_si(struct smi_info *smi_info)
22282228
kfree(smi_info);
22292229
}
22302230

2231-
int ipmi_si_remove_by_dev(struct device *dev)
2231+
void ipmi_si_remove_by_dev(struct device *dev)
22322232
{
22332233
struct smi_info *e;
2234-
int rv = -ENOENT;
22352234

22362235
mutex_lock(&smi_infos_lock);
22372236
list_for_each_entry(e, &smi_infos, link) {
22382237
if (e->io.dev == dev) {
22392238
cleanup_one_si(e);
2240-
rv = 0;
22412239
break;
22422240
}
22432241
}
22442242
mutex_unlock(&smi_infos_lock);
2245-
2246-
return rv;
22472243
}
22482244

22492245
struct device *ipmi_si_remove_by_data(int addr_space, enum si_type si_type,

drivers/char/ipmi/ipmi_si_parisc.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ static int __init ipmi_parisc_probe(struct parisc_device *dev)
2929
return ipmi_si_add_smi(&io);
3030
}
3131

32-
static int __exit ipmi_parisc_remove(struct parisc_device *dev)
32+
static void __exit ipmi_parisc_remove(struct parisc_device *dev)
3333
{
34-
return ipmi_si_remove_by_dev(&dev->dev);
34+
ipmi_si_remove_by_dev(&dev->dev);
3535
}
3636

3737
static const struct parisc_device_id ipmi_parisc_tbl[] __initconst = {

drivers/char/ipmi/ipmi_si_platform.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,9 @@ static int ipmi_probe(struct platform_device *pdev)
411411

412412
static int ipmi_remove(struct platform_device *pdev)
413413
{
414-
return ipmi_si_remove_by_dev(&pdev->dev);
414+
ipmi_si_remove_by_dev(&pdev->dev);
415+
416+
return 0;
415417
}
416418

417419
static int pdev_match_name(struct device *dev, const void *data)

drivers/input/keyboard/hilkbd.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -316,11 +316,9 @@ static int __init hil_probe_chip(struct parisc_device *dev)
316316
return hil_keyb_init();
317317
}
318318

319-
static int __exit hil_remove_chip(struct parisc_device *dev)
319+
static void __exit hil_remove_chip(struct parisc_device *dev)
320320
{
321321
hil_keyb_exit();
322-
323-
return 0;
324322
}
325323

326324
static const struct parisc_device_id hil_tbl[] __initconst = {

drivers/input/serio/gscps2.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,7 @@ static int __init gscps2_probe(struct parisc_device *dev)
411411
* @return: success/error report
412412
*/
413413

414-
static int __exit gscps2_remove(struct parisc_device *dev)
414+
static void __exit gscps2_remove(struct parisc_device *dev)
415415
{
416416
struct gscps2port *ps2port = dev_get_drvdata(&dev->dev);
417417

@@ -425,7 +425,6 @@ static int __exit gscps2_remove(struct parisc_device *dev)
425425
#endif
426426
dev_set_drvdata(&dev->dev, NULL);
427427
kfree(ps2port);
428-
return 0;
429428
}
430429

431430

drivers/net/ethernet/i825xx/lasi_82596.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ lan_init_chip(struct parisc_device *dev)
196196
return retval;
197197
}
198198

199-
static int __exit lan_remove_chip(struct parisc_device *pdev)
199+
static void __exit lan_remove_chip(struct parisc_device *pdev)
200200
{
201201
struct net_device *dev = parisc_get_drvdata(pdev);
202202
struct i596_private *lp = netdev_priv(dev);
@@ -205,7 +205,6 @@ static int __exit lan_remove_chip(struct parisc_device *pdev)
205205
dma_free_noncoherent(&pdev->dev, sizeof(struct i596_private), lp->dma,
206206
lp->dma_addr, DMA_BIDIRECTIONAL);
207207
free_netdev (dev);
208-
return 0;
209208
}
210209

211210
static const struct parisc_device_id lan_tbl[] __initconst = {

drivers/parport/parport_gsc.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ static int __init parport_init_chip(struct parisc_device *dev)
378378
return 0;
379379
}
380380

381-
static int __exit parport_remove_chip(struct parisc_device *dev)
381+
static void __exit parport_remove_chip(struct parisc_device *dev)
382382
{
383383
struct parport *p = dev_get_drvdata(&dev->dev);
384384
if (p) {
@@ -397,7 +397,6 @@ static int __exit parport_remove_chip(struct parisc_device *dev)
397397
parport_put_port(p);
398398
kfree (ops); /* hope no-one cached it */
399399
}
400-
return 0;
401400
}
402401

403402
static const struct parisc_device_id parport_tbl[] __initconst = {

drivers/scsi/lasi700.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ lasi700_probe(struct parisc_device *dev)
134134
return -ENODEV;
135135
}
136136

137-
static int __exit
137+
static void __exit
138138
lasi700_driver_remove(struct parisc_device *dev)
139139
{
140140
struct Scsi_Host *host = dev_get_drvdata(&dev->dev);
@@ -146,8 +146,6 @@ lasi700_driver_remove(struct parisc_device *dev)
146146
free_irq(host->irq, host);
147147
iounmap(hostdata->base);
148148
kfree(hostdata);
149-
150-
return 0;
151149
}
152150

153151
static struct parisc_driver lasi700_driver __refdata = {

0 commit comments

Comments
 (0)