Netdev Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Finn Thain <fthain@linux-m68k.org>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org, kernel@pengutronix.de,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	Zhang Qilong <zhangqilong3@huawei.com>,
	Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
	netdev@vger.kernel.org, linux-m68k@lists.linux-m68k.org
Subject: Re: [PATCH 2/5] nubus: Make struct nubus_driver::remove return void
Date: Tue, 27 Jul 2021 19:47:30 +1000 (AEST)	[thread overview]
Message-ID: <59bc4bf-7e8e-24be-5a7a-d165e6b73c32@linux-m68k.org> (raw)
In-Reply-To: <20210727080840.3550927-3-u.kleine-koenig@pengutronix.de>

[-- Attachment #1: Type: text/plain, Size: 2707 bytes --]

On Tue, 27 Jul 2021, Uwe Kleine-König wrote:

> 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>

> ---
>  drivers/net/ethernet/8390/mac8390.c     | 3 +--
>  drivers/net/ethernet/natsemi/macsonic.c | 4 +---
>  include/linux/nubus.h                   | 2 +-
>  3 files changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/net/ethernet/8390/mac8390.c b/drivers/net/ethernet/8390/mac8390.c
> index 9aac7119d382..91b04abfd687 100644
> --- a/drivers/net/ethernet/8390/mac8390.c
> +++ b/drivers/net/ethernet/8390/mac8390.c
> @@ -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 = {
> diff --git a/drivers/net/ethernet/natsemi/macsonic.c b/drivers/net/ethernet/natsemi/macsonic.c
> index 2289e1fe3741..8709d700e15a 100644
> --- a/drivers/net/ethernet/natsemi/macsonic.c
> +++ b/drivers/net/ethernet/natsemi/macsonic.c
> @@ -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);
> @@ -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 = {
> diff --git a/include/linux/nubus.h b/include/linux/nubus.h
> index eba50b057f6f..392fc6c53e96 100644
> --- a/include/linux/nubus.h
> +++ b/include/linux/nubus.h
> @@ -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;
> 

      reply	other threads:[~2021-07-27  9:47 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-27  8:08 [PATCH 0/5] Some cleanups after making bus_type::remove " Uwe Kleine-König
2021-07-27  8:08 ` [PATCH 2/5] nubus: Make struct nubus_driver::remove " Uwe Kleine-König
2021-07-27  9:47   ` Finn Thain [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=59bc4bf-7e8e-24be-5a7a-d165e6b73c32@linux-m68k.org \
    --to=fthain@linux-m68k.org \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=davem@davemloft.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel@pengutronix.de \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@lists.linux-m68k.org \
    --cc=netdev@vger.kernel.org \
    --cc=u.kleine-koenig@pengutronix.de \
    --cc=zhangqilong3@huawei.com \
    --subject='Re: [PATCH 2/5] nubus: Make struct nubus_driver::remove return void' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).