Linux-Watchdog Archive on lore.kernel.org
 help / color / Atom feed
From: Guenter Roeck <linux@roeck-us.net>
To: "Uwe Kleine-König" <uwe@kleine-koenig.org>,
	"Tomas Winkler" <tomas.winkler@intel.com>,
	"Arnd Bergmann" <arnd@arndb.de>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Wim Van Sebroeck" <wim@linux-watchdog.org>
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	linux-watchdog@vger.kernel.org
Subject: Re: [PATCH v1 2/2] mei: bus: change remove callback to return void
Date: Sun, 7 Feb 2021 15:48:10 -0800
Message-ID: <3bf2c0dd-9c96-573c-e9db-dd0c66ff1523@roeck-us.net> (raw)
In-Reply-To: <20210207222224.97547-2-uwe@kleine-koenig.org>

On 2/7/21 2:22 PM, Uwe Kleine-König wrote:
> The driver core ignores the return value of mei_cl_device_remove() so
> passing an error value doesn't solve any problem. As most mei drivers'
> remove callbacks return 0 unconditionally and returning a different value
> doesn't have any effect, change this prototype to return void and return 0
> unconditionally in mei_cl_device_remove(). The only driver that could
> return an error value is modified to emit an explicit warning in the error
> case.
> 
> Signed-off-by: Uwe Kleine-König <uwe@kleine-koenig.org>
> ---
>  drivers/misc/mei/bus.c           | 5 ++---
>  drivers/misc/mei/hdcp/mei_hdcp.c | 7 +++++--
>  drivers/nfc/microread/mei.c      | 4 +---
>  drivers/nfc/pn544/mei.c          | 4 +---
>  drivers/watchdog/mei_wdt.c       | 4 +---

Acked-by: Guenter Roeck <linux@roeck-us.net>

>  include/linux/mei_cl_bus.h       | 2 +-
>  6 files changed, 11 insertions(+), 15 deletions(-)
> 
> diff --git a/drivers/misc/mei/bus.c b/drivers/misc/mei/bus.c
> index 50d617e7467e..54dddae46705 100644
> --- a/drivers/misc/mei/bus.c
> +++ b/drivers/misc/mei/bus.c
> @@ -879,17 +879,16 @@ static int mei_cl_device_remove(struct device *dev)
>  {
>  	struct mei_cl_device *cldev = to_mei_cl_device(dev);
>  	struct mei_cl_driver *cldrv = to_mei_cl_driver(dev->driver);
> -	int ret = 0;
>  
>  	if (cldrv->remove)
> -		ret = cldrv->remove(cldev);
> +		cldrv->remove(cldev);
>  
>  	mei_cldev_unregister_callbacks(cldev);
>  
>  	mei_cl_bus_module_put(cldev);
>  	module_put(THIS_MODULE);
>  
> -	return ret;
> +	return 0;
>  }
>  
>  static ssize_t name_show(struct device *dev, struct device_attribute *a,
> diff --git a/drivers/misc/mei/hdcp/mei_hdcp.c b/drivers/misc/mei/hdcp/mei_hdcp.c
> index 9ae9669e46ea..6a455ebe4891 100644
> --- a/drivers/misc/mei/hdcp/mei_hdcp.c
> +++ b/drivers/misc/mei/hdcp/mei_hdcp.c
> @@ -845,16 +845,19 @@ static int mei_hdcp_probe(struct mei_cl_device *cldev,
>  	return ret;
>  }
>  
> -static int mei_hdcp_remove(struct mei_cl_device *cldev)
> +static void mei_hdcp_remove(struct mei_cl_device *cldev)
>  {
>  	struct i915_hdcp_comp_master *comp_master =
>  						mei_cldev_get_drvdata(cldev);
> +	int ret;
>  
>  	component_master_del(&cldev->dev, &mei_component_master_ops);
>  	kfree(comp_master);
>  	mei_cldev_set_drvdata(cldev, NULL);
>  
> -	return mei_cldev_disable(cldev);
> +	ret = mei_cldev_disable(cldev);
> +	if (ret)
> +		dev_warn(&cldev->dev, "mei_cldev_disable() failed\n")
>  }
>  
>  #define MEI_UUID_HDCP GUID_INIT(0xB638AB7E, 0x94E2, 0x4EA2, 0xA5, \
> diff --git a/drivers/nfc/microread/mei.c b/drivers/nfc/microread/mei.c
> index 5dad8847a9b3..8fa7771085eb 100644
> --- a/drivers/nfc/microread/mei.c
> +++ b/drivers/nfc/microread/mei.c
> @@ -44,15 +44,13 @@ static int microread_mei_probe(struct mei_cl_device *cldev,
>  	return 0;
>  }
>  
> -static int microread_mei_remove(struct mei_cl_device *cldev)
> +static void microread_mei_remove(struct mei_cl_device *cldev)
>  {
>  	struct nfc_mei_phy *phy = mei_cldev_get_drvdata(cldev);
>  
>  	microread_remove(phy->hdev);
>  
>  	nfc_mei_phy_free(phy);
> -
> -	return 0;
>  }
>  
>  static struct mei_cl_device_id microread_mei_tbl[] = {
> diff --git a/drivers/nfc/pn544/mei.c b/drivers/nfc/pn544/mei.c
> index 579bc599f545..5c10aac085a4 100644
> --- a/drivers/nfc/pn544/mei.c
> +++ b/drivers/nfc/pn544/mei.c
> @@ -42,7 +42,7 @@ static int pn544_mei_probe(struct mei_cl_device *cldev,
>  	return 0;
>  }
>  
> -static int pn544_mei_remove(struct mei_cl_device *cldev)
> +static void pn544_mei_remove(struct mei_cl_device *cldev)
>  {
>  	struct nfc_mei_phy *phy = mei_cldev_get_drvdata(cldev);
>  
> @@ -51,8 +51,6 @@ static int pn544_mei_remove(struct mei_cl_device *cldev)
>  	pn544_hci_remove(phy->hdev);
>  
>  	nfc_mei_phy_free(phy);
> -
> -	return 0;
>  }
>  
>  static struct mei_cl_device_id pn544_mei_tbl[] = {
> diff --git a/drivers/watchdog/mei_wdt.c b/drivers/watchdog/mei_wdt.c
> index 5391bf3e6b11..53165e49c298 100644
> --- a/drivers/watchdog/mei_wdt.c
> +++ b/drivers/watchdog/mei_wdt.c
> @@ -619,7 +619,7 @@ static int mei_wdt_probe(struct mei_cl_device *cldev,
>  	return ret;
>  }
>  
> -static int mei_wdt_remove(struct mei_cl_device *cldev)
> +static void mei_wdt_remove(struct mei_cl_device *cldev)
>  {
>  	struct mei_wdt *wdt = mei_cldev_get_drvdata(cldev);
>  
> @@ -636,8 +636,6 @@ static int mei_wdt_remove(struct mei_cl_device *cldev)
>  	dbgfs_unregister(wdt);
>  
>  	kfree(wdt);
> -
> -	return 0;
>  }
>  
>  #define MEI_UUID_WD UUID_LE(0x05B79A6F, 0x4628, 0x4D7F, \
> diff --git a/include/linux/mei_cl_bus.h b/include/linux/mei_cl_bus.h
> index 959ad7d850b4..07f5ef8fc456 100644
> --- a/include/linux/mei_cl_bus.h
> +++ b/include/linux/mei_cl_bus.h
> @@ -68,7 +68,7 @@ struct mei_cl_driver {
>  
>  	int (*probe)(struct mei_cl_device *cldev,
>  		     const struct mei_cl_device_id *id);
> -	int (*remove)(struct mei_cl_device *cldev);
> +	void (*remove)(struct mei_cl_device *cldev);
>  };
>  
>  int __mei_cldev_driver_register(struct mei_cl_driver *cldrv,
> 


  reply index

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-07 22:22 [PATCH v1 1/2] mei: bus: simplify mei_cl_device_remove() Uwe Kleine-König
2021-02-07 22:22 ` [PATCH v1 2/2] mei: bus: change remove callback to return void Uwe Kleine-König
2021-02-07 23:48   ` Guenter Roeck [this message]
2021-02-08  0:16   ` kernel test robot
2021-02-08  0:16   ` kernel test robot
2021-02-08  0:17   ` kernel test robot

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=3bf2c0dd-9c96-573c-e9db-dd0c66ff1523@roeck-us.net \
    --to=linux@roeck-us.net \
    --cc=arnd@arndb.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=tomas.winkler@intel.com \
    --cc=uwe@kleine-koenig.org \
    --cc=wim@linux-watchdog.org \
    /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

Linux-Watchdog Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-watchdog/0 linux-watchdog/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-watchdog linux-watchdog/ https://lore.kernel.org/linux-watchdog \
		linux-watchdog@vger.kernel.org
	public-inbox-index linux-watchdog

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-watchdog


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git