From: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
To: Dmitry Osipenko <digetx@gmail.com>
Cc: linuxarm@huawei.com, mauro.chehab@huawei.com,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Jonathan Hunter <jonathanh@nvidia.com>,
Mauro Carvalho Chehab <mchehab@kernel.org>,
Thierry Reding <thierry.reding@gmail.com>,
devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
linux-media@vger.kernel.org, linux-tegra@vger.kernel.org
Subject: Re: [PATCH v3 25/79] staging: media: vde: use pm_runtime_resume_and_get()
Date: Wed, 28 Apr 2021 09:20:43 +0200 [thread overview]
Message-ID: <20210428092043.380c9d4c@coco.lan> (raw)
In-Reply-To: <2e8bdea5-b2a7-df95-9d93-7c1f2df6158d@gmail.com>
Em Tue, 27 Apr 2021 14:47:01 +0300
Dmitry Osipenko <digetx@gmail.com> escreveu:
> 27.04.2021 13:26, Mauro Carvalho Chehab пишет:
> > @@ -1088,8 +1090,9 @@ static int tegra_vde_remove(struct platform_device *pdev)
> > {
> > struct tegra_vde *vde = platform_get_drvdata(pdev);
> > struct device *dev = &pdev->dev;
> > + int ret;
> >
> > - pm_runtime_get_sync(dev);
> > + ret = pm_runtime_resume_and_get(dev);
>
> Should be cleaner to return error directly here, IMO.
I double-checked how drivers/base/platform.c deals with non-zero
returns at the .remove method:
static int platform_remove(struct device *_dev)
{
struct platform_driver *drv = to_platform_driver(_dev->driver);
struct platform_device *dev = to_platform_device(_dev);
if (drv->remove) {
int ret = drv->remove(dev);
if (ret)
dev_warn(_dev, "remove callback returned a non-zero value. This will be ignored.\n");
}
dev_pm_domain_detach(_dev, true);
return 0;
}
Basically, it will print a message but will ignore whatever happens
afterwards.
So, if the driver is changed to return an error there, it will leak
resources.
Thanks,
Mauro
next prev parent reply other threads:[~2021-04-28 7:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-27 10:25 [PATCH v3 00/79] Address some issues with PM runtime at media subsystem Mauro Carvalho Chehab
2021-04-27 10:26 ` [PATCH v3 25/79] staging: media: vde: use pm_runtime_resume_and_get() Mauro Carvalho Chehab
2021-04-27 11:47 ` Dmitry Osipenko
2021-04-28 7:20 ` Mauro Carvalho Chehab [this message]
2021-04-28 8:05 ` Dmitry Osipenko
2021-04-27 10:26 ` [PATCH v3 26/79] staging: media: csi: " Mauro Carvalho Chehab
2021-04-27 10:26 ` [PATCH v3 27/79] staging: media: vi: " Mauro Carvalho Chehab
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=20210428092043.380c9d4c@coco.lan \
--to=mchehab+huawei@kernel.org \
--cc=devel@driverdev.osuosl.org \
--cc=digetx@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=jonathanh@nvidia.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=mauro.chehab@huawei.com \
--cc=mchehab@kernel.org \
--cc=thierry.reding@gmail.com \
/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
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox