mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 12:28:41 +08:00
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>
This commit is contained in:
parent
d220da0967
commit
87875c1084
@ -34,8 +34,8 @@ struct parisc_driver {
|
||||
struct parisc_driver *next;
|
||||
char *name;
|
||||
const struct parisc_device_id *id_table;
|
||||
int (*probe) (struct parisc_device *dev); /* New device discovered */
|
||||
int (*remove) (struct parisc_device *dev);
|
||||
int (*probe)(struct parisc_device *dev); /* New device discovered */
|
||||
void (*remove)(struct parisc_device *dev);
|
||||
struct device_driver drv;
|
||||
};
|
||||
|
||||
|
@ -73,7 +73,7 @@ irqreturn_t ipmi_si_irq_handler(int irq, void *data);
|
||||
void ipmi_irq_start_cleanup(struct si_sm_io *io);
|
||||
int ipmi_std_irq_setup(struct si_sm_io *io);
|
||||
void ipmi_irq_finish_setup(struct si_sm_io *io);
|
||||
int ipmi_si_remove_by_dev(struct device *dev);
|
||||
void ipmi_si_remove_by_dev(struct device *dev);
|
||||
struct device *ipmi_si_remove_by_data(int addr_space, enum si_type si_type,
|
||||
unsigned long addr);
|
||||
void ipmi_hardcode_init(void);
|
||||
|
@ -2228,22 +2228,18 @@ static void cleanup_one_si(struct smi_info *smi_info)
|
||||
kfree(smi_info);
|
||||
}
|
||||
|
||||
int ipmi_si_remove_by_dev(struct device *dev)
|
||||
void ipmi_si_remove_by_dev(struct device *dev)
|
||||
{
|
||||
struct smi_info *e;
|
||||
int rv = -ENOENT;
|
||||
|
||||
mutex_lock(&smi_infos_lock);
|
||||
list_for_each_entry(e, &smi_infos, link) {
|
||||
if (e->io.dev == dev) {
|
||||
cleanup_one_si(e);
|
||||
rv = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
mutex_unlock(&smi_infos_lock);
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
struct device *ipmi_si_remove_by_data(int addr_space, enum si_type si_type,
|
||||
|
@ -29,9 +29,9 @@ static int __init ipmi_parisc_probe(struct parisc_device *dev)
|
||||
return ipmi_si_add_smi(&io);
|
||||
}
|
||||
|
||||
static int __exit ipmi_parisc_remove(struct parisc_device *dev)
|
||||
static void __exit ipmi_parisc_remove(struct parisc_device *dev)
|
||||
{
|
||||
return ipmi_si_remove_by_dev(&dev->dev);
|
||||
ipmi_si_remove_by_dev(&dev->dev);
|
||||
}
|
||||
|
||||
static const struct parisc_device_id ipmi_parisc_tbl[] __initconst = {
|
||||
|
@ -411,7 +411,9 @@ static int ipmi_probe(struct platform_device *pdev)
|
||||
|
||||
static int ipmi_remove(struct platform_device *pdev)
|
||||
{
|
||||
return ipmi_si_remove_by_dev(&pdev->dev);
|
||||
ipmi_si_remove_by_dev(&pdev->dev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int pdev_match_name(struct device *dev, const void *data)
|
||||
|
@ -316,11 +316,9 @@ static int __init hil_probe_chip(struct parisc_device *dev)
|
||||
return hil_keyb_init();
|
||||
}
|
||||
|
||||
static int __exit hil_remove_chip(struct parisc_device *dev)
|
||||
static void __exit hil_remove_chip(struct parisc_device *dev)
|
||||
{
|
||||
hil_keyb_exit();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct parisc_device_id hil_tbl[] __initconst = {
|
||||
|
@ -411,7 +411,7 @@ fail_nomem:
|
||||
* @return: success/error report
|
||||
*/
|
||||
|
||||
static int __exit gscps2_remove(struct parisc_device *dev)
|
||||
static void __exit gscps2_remove(struct parisc_device *dev)
|
||||
{
|
||||
struct gscps2port *ps2port = dev_get_drvdata(&dev->dev);
|
||||
|
||||
@ -425,7 +425,6 @@ static int __exit gscps2_remove(struct parisc_device *dev)
|
||||
#endif
|
||||
dev_set_drvdata(&dev->dev, NULL);
|
||||
kfree(ps2port);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
@ -196,7 +196,7 @@ out_free_netdev:
|
||||
return retval;
|
||||
}
|
||||
|
||||
static int __exit lan_remove_chip(struct parisc_device *pdev)
|
||||
static void __exit lan_remove_chip(struct parisc_device *pdev)
|
||||
{
|
||||
struct net_device *dev = parisc_get_drvdata(pdev);
|
||||
struct i596_private *lp = netdev_priv(dev);
|
||||
@ -205,7 +205,6 @@ static int __exit lan_remove_chip(struct parisc_device *pdev)
|
||||
dma_free_noncoherent(&pdev->dev, sizeof(struct i596_private), lp->dma,
|
||||
lp->dma_addr, DMA_BIDIRECTIONAL);
|
||||
free_netdev (dev);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct parisc_device_id lan_tbl[] __initconst = {
|
||||
|
@ -378,7 +378,7 @@ static int __init parport_init_chip(struct parisc_device *dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __exit parport_remove_chip(struct parisc_device *dev)
|
||||
static void __exit parport_remove_chip(struct parisc_device *dev)
|
||||
{
|
||||
struct parport *p = dev_get_drvdata(&dev->dev);
|
||||
if (p) {
|
||||
@ -397,7 +397,6 @@ static int __exit parport_remove_chip(struct parisc_device *dev)
|
||||
parport_put_port(p);
|
||||
kfree (ops); /* hope no-one cached it */
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct parisc_device_id parport_tbl[] __initconst = {
|
||||
|
@ -134,7 +134,7 @@ lasi700_probe(struct parisc_device *dev)
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
static int __exit
|
||||
static void __exit
|
||||
lasi700_driver_remove(struct parisc_device *dev)
|
||||
{
|
||||
struct Scsi_Host *host = dev_get_drvdata(&dev->dev);
|
||||
@ -146,8 +146,6 @@ lasi700_driver_remove(struct parisc_device *dev)
|
||||
free_irq(host->irq, host);
|
||||
iounmap(hostdata->base);
|
||||
kfree(hostdata);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct parisc_driver lasi700_driver __refdata = {
|
||||
|
@ -168,15 +168,13 @@ static const struct parisc_device_id zalon_tbl[] __initconst = {
|
||||
|
||||
MODULE_DEVICE_TABLE(parisc, zalon_tbl);
|
||||
|
||||
static int __exit zalon_remove(struct parisc_device *dev)
|
||||
static void __exit zalon_remove(struct parisc_device *dev)
|
||||
{
|
||||
struct Scsi_Host *host = dev_get_drvdata(&dev->dev);
|
||||
|
||||
scsi_remove_host(host);
|
||||
ncr53c8xx_release(host);
|
||||
free_irq(dev->irq, host);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct parisc_driver zalon_driver __refdata = {
|
||||
|
@ -496,7 +496,7 @@ static int __init mux_probe(struct parisc_device *dev)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int __exit mux_remove(struct parisc_device *dev)
|
||||
static void __exit mux_remove(struct parisc_device *dev)
|
||||
{
|
||||
int i, j;
|
||||
int port_count = (long)dev_get_drvdata(&dev->dev);
|
||||
@ -518,7 +518,6 @@ static int __exit mux_remove(struct parisc_device *dev)
|
||||
}
|
||||
|
||||
release_mem_region(dev->hpa.start + MUX_OFFSET, port_count * MUX_LINE_OFFSET);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* Hack. This idea was taken from the 8250_gsc.c on how to properly order
|
||||
|
@ -968,11 +968,10 @@ free_and_ret:
|
||||
return err;
|
||||
}
|
||||
|
||||
static int __exit
|
||||
static void __exit
|
||||
snd_harmony_remove(struct parisc_device *padev)
|
||||
{
|
||||
snd_card_free(parisc_get_drvdata(padev));
|
||||
return 0;
|
||||
}
|
||||
|
||||
static struct parisc_driver snd_harmony_driver __refdata = {
|
||||
|
Loading…
Reference in New Issue
Block a user