Skip to content

Commit

Permalink
nubus: Make struct nubus_driver::remove return void
Browse files Browse the repository at this point in the history
The nubus core ignores the return value of the remove callback (in
nubus_device_remove()) and all implementers return 0 anyway.

So make it impossible for future drivers to return an unused error code
by changing the remove prototype to return void.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Finn Thain <fthain@linux-m68k.org>
Link: https://lore.kernel.org/r/20210727080840.3550927-3-u.kleine-koenig@pengutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Uwe Kleine-König authored and Greg Kroah-Hartman committed Jul 28, 2021
1 parent df6192f commit b2c943e
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions drivers/net/ethernet/8390/mac8390.c
Original file line number Diff line number Diff line change
Expand Up @@ -428,13 +428,12 @@ static int mac8390_device_probe(struct nubus_board *board)
return err;
}

static int mac8390_device_remove(struct nubus_board *board)
static void mac8390_device_remove(struct nubus_board *board)
{
struct net_device *dev = nubus_get_drvdata(board);

unregister_netdev(dev);
free_netdev(dev);
return 0;
}

static struct nubus_driver mac8390_driver = {
Expand Down
4 changes: 1 addition & 3 deletions drivers/net/ethernet/natsemi/macsonic.c
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ static int mac_sonic_nubus_probe(struct nubus_board *board)
return err;
}

static int mac_sonic_nubus_remove(struct nubus_board *board)
static void mac_sonic_nubus_remove(struct nubus_board *board)
{
struct net_device *ndev = nubus_get_drvdata(board);
struct sonic_local *lp = netdev_priv(ndev);
Expand All @@ -613,8 +613,6 @@ static int mac_sonic_nubus_remove(struct nubus_board *board)
SIZEOF_SONIC_DESC * SONIC_BUS_SCALE(lp->dma_bitmode),
lp->descriptors, lp->descriptors_laddr);
free_netdev(ndev);

return 0;
}

static struct nubus_driver mac_sonic_nubus_driver = {
Expand Down
2 changes: 1 addition & 1 deletion include/linux/nubus.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ extern struct list_head nubus_func_rsrcs;
struct nubus_driver {
struct device_driver driver;
int (*probe)(struct nubus_board *board);
int (*remove)(struct nubus_board *board);
void (*remove)(struct nubus_board *board);
};

extern struct bus_type nubus_bus_type;
Expand Down

0 comments on commit b2c943e

Please sign in to comment.