lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20201125205328.q6zjoq4k5u4xvipw@pengutronix.de>
Date:   Wed, 25 Nov 2020 21:53:28 +0100
From:   Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
To:     Julia Lawall <Julia.Lawall@...ia.fr>
Cc:     linux-kernel@...r.kernel.org, kernel@...gutronix.de,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: Re: [PATCH v1] drivers: make struct device_driver::remove return void

Hello Julia,

On Tue, Nov 10, 2020 at 04:07:23PM +0100, Uwe Kleine-König wrote:
> diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c
> index ecc304149067..ed79a5c657e5 100644
> --- a/drivers/amba/bus.c
> +++ b/drivers/amba/bus.c
> @@ -295,7 +295,7 @@ static int amba_probe(struct device *dev)
>  	return ret;
>  }
>  
> -static int amba_remove(struct device *dev)
> +static void amba_remove(struct device *dev)
>  {
>  	struct amba_device *pcdev = to_amba_device(dev);
>  	struct amba_driver *drv = to_amba_driver(dev->driver);
> @@ -303,6 +303,9 @@ static int amba_remove(struct device *dev)
>  
>  	pm_runtime_get_sync(dev);
>  	ret = drv->remove(pcdev);
> +	if (ret)
> +		dev_info(dev, "Failed to remove (%pe), ignoring\n",
> +			 ERR_PTR(ret));
>  	pm_runtime_put_noidle(dev);
>  
>  	/* Undo the runtime PM settings in amba_probe() */
> @@ -312,8 +315,6 @@ static int amba_remove(struct device *dev)
>  
>  	amba_put_disable_pclk(pcdev);
>  	dev_pm_domain_detach(dev, true);
> -
> -	return ret;
>  }
>  
>  static void amba_shutdown(struct device *dev)
> [...]
> diff --git a/include/linux/device/driver.h b/include/linux/device/driver.h
> index ee7ba5b5417e..6a3058d4476a 100644
> --- a/include/linux/device/driver.h
> +++ b/include/linux/device/driver.h
> @@ -107,7 +107,7 @@ struct device_driver {
>  
>  	int (*probe) (struct device *dev);
>  	void (*sync_state)(struct device *dev);
> -	int (*remove) (struct device *dev);
> +	void (*remove) (struct device *dev);
>  	void (*shutdown) (struct device *dev);
>  	int (*suspend) (struct device *dev, pm_message_t state);
>  	int (*resume) (struct device *dev);

I tried to let coccinelle help me finding functions I need to adapt for
this change, but I failed. (That is, functions that currently return an
int and are used to set (or initialize) the remove callback for a struct
device_driver.) Can you help me here?

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ