Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1201352 > unrolled thread
| Started by | Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
|---|---|
| First post | 2015-08-06 02:10 +0200 |
| Last post | 2015-08-06 02:10 +0200 |
| Articles | 1 — 1 participant |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH] base/platform: assert that dev_pm_domain callbacks are called unconditionally Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2015-08-06 02:10 +0200
| From | Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
|---|---|
| Date | 2015-08-06 02:10 +0200 |
| Subject | Re: [PATCH] base/platform: assert that dev_pm_domain callbacks are called unconditionally |
| Message-ID | <pUgUW-eG-17@gated-at.bofh.it> |
On Tue, Jul 21, 2015 at 05:08:35PM +0200, Uwe Kleine-König wrote:
> When a platform driver doesn't provide a .remove callback the function
> platform_drv_remove isn't called and so the call to dev_pm_domain_attach
> called at probe time isn't paired by dev_pm_domain_detach at remove
> time.
>
> To fix this (and similar issues if different callbacks are missing) hook
> up the driver callbacks unconditionally and make them aware that the
> platform callbacks might be missing.
>
> Signed-off-by: Uwe Kleine-König <uwe@kleine-koenig.org>
> ---
> Hello,
>
> I didn't see any breakage without this patch, but it looks wrong the way
> it is.
>
> Best regards
> Uwe
>
> drivers/base/platform.c | 17 ++++++++---------
> 1 file changed, 8 insertions(+), 9 deletions(-)
>
> diff --git a/drivers/base/platform.c b/drivers/base/platform.c
> index 063f0ab15259..62debf4a1348 100644
> --- a/drivers/base/platform.c
> +++ b/drivers/base/platform.c
> @@ -517,7 +517,7 @@ static int platform_drv_probe(struct device *_dev)
> return ret;
>
> ret = dev_pm_domain_attach(_dev, true);
> - if (ret != -EPROBE_DEFER) {
> + if (ret != -EPROBE_DEFER && drv->probe) {
> ret = drv->probe(dev);
> if (ret)
> dev_pm_domain_detach(_dev, true);
> @@ -542,7 +542,8 @@ static int platform_drv_remove(struct device *_dev)
> struct platform_device *dev = to_platform_device(_dev);
> int ret;
>
> - ret = drv->remove(dev);
> + if (drv->remove)
> + ret = drv->remove(dev);
> dev_pm_domain_detach(_dev, true);
This causes a build warning :(
Please fix.
thanks,
greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to top | Article view | linux.kernel
csiph-web