* [PATCH v1] media: staging: tegra-vde: Use devm_platform_ioremap_resource_byname()
@ 2020-02-27 18:09 Dmitry Osipenko
2020-03-02 8:04 ` Dan Carpenter
0 siblings, 1 reply; 4+ messages in thread
From: Dmitry Osipenko @ 2020-02-27 18:09 UTC (permalink / raw)
To: Thierry Reding, Jonathan Hunter, Mauro Carvalho Chehab, Hans Verkuil
Cc: linux-media, linux-tegra, devel, linux-kernel
This helps to make code cleaner a tad.
Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
---
drivers/staging/media/tegra-vde/vde.c | 55 +++++----------------------
1 file changed, 9 insertions(+), 46 deletions(-)
diff --git a/drivers/staging/media/tegra-vde/vde.c b/drivers/staging/media/tegra-vde/vde.c
index e18fd48981da..d3e63512a765 100644
--- a/drivers/staging/media/tegra-vde/vde.c
+++ b/drivers/staging/media/tegra-vde/vde.c
@@ -949,7 +949,6 @@ static int tegra_vde_runtime_resume(struct device *dev)
static int tegra_vde_probe(struct platform_device *pdev)
{
struct device *dev = &pdev->dev;
- struct resource *regs;
struct tegra_vde *vde;
int irq, err;
@@ -959,75 +958,39 @@ static int tegra_vde_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, vde);
- regs = platform_get_resource_byname(pdev, IORESOURCE_MEM, "sxe");
- if (!regs)
- return -ENODEV;
-
- vde->sxe = devm_ioremap_resource(dev, regs);
+ vde->sxe = devm_platform_ioremap_resource_byname(pdev, "sxe");
if (IS_ERR(vde->sxe))
return PTR_ERR(vde->sxe);
- regs = platform_get_resource_byname(pdev, IORESOURCE_MEM, "bsev");
- if (!regs)
- return -ENODEV;
-
- vde->bsev = devm_ioremap_resource(dev, regs);
+ vde->bsev = devm_platform_ioremap_resource_byname(pdev, "bsev");
if (IS_ERR(vde->bsev))
return PTR_ERR(vde->bsev);
- regs = platform_get_resource_byname(pdev, IORESOURCE_MEM, "mbe");
- if (!regs)
- return -ENODEV;
-
- vde->mbe = devm_ioremap_resource(dev, regs);
+ vde->mbe = devm_platform_ioremap_resource_byname(pdev, "mbe");
if (IS_ERR(vde->mbe))
return PTR_ERR(vde->mbe);
- regs = platform_get_resource_byname(pdev, IORESOURCE_MEM, "ppe");
- if (!regs)
- return -ENODEV;
-
- vde->ppe = devm_ioremap_resource(dev, regs);
+ vde->ppe = devm_platform_ioremap_resource_byname(pdev, "ppe");
if (IS_ERR(vde->ppe))
return PTR_ERR(vde->ppe);
- regs = platform_get_resource_byname(pdev, IORESOURCE_MEM, "mce");
- if (!regs)
- return -ENODEV;
-
- vde->mce = devm_ioremap_resource(dev, regs);
+ vde->mce = devm_platform_ioremap_resource_byname(pdev, "mce");
if (IS_ERR(vde->mce))
return PTR_ERR(vde->mce);
- regs = platform_get_resource_byname(pdev, IORESOURCE_MEM, "tfe");
- if (!regs)
- return -ENODEV;
-
- vde->tfe = devm_ioremap_resource(dev, regs);
+ vde->tfe = devm_platform_ioremap_resource_byname(pdev, "tfe");
if (IS_ERR(vde->tfe))
return PTR_ERR(vde->tfe);
- regs = platform_get_resource_byname(pdev, IORESOURCE_MEM, "ppb");
- if (!regs)
- return -ENODEV;
-
- vde->ppb = devm_ioremap_resource(dev, regs);
+ vde->ppb = devm_platform_ioremap_resource_byname(pdev, "ppb");
if (IS_ERR(vde->ppb))
return PTR_ERR(vde->ppb);
- regs = platform_get_resource_byname(pdev, IORESOURCE_MEM, "vdma");
- if (!regs)
- return -ENODEV;
-
- vde->vdma = devm_ioremap_resource(dev, regs);
+ vde->vdma = devm_platform_ioremap_resource_byname(pdev, "vdma");
if (IS_ERR(vde->vdma))
return PTR_ERR(vde->vdma);
- regs = platform_get_resource_byname(pdev, IORESOURCE_MEM, "frameid");
- if (!regs)
- return -ENODEV;
-
- vde->frameid = devm_ioremap_resource(dev, regs);
+ vde->frameid = devm_platform_ioremap_resource_byname(pdev, "frameid");
if (IS_ERR(vde->frameid))
return PTR_ERR(vde->frameid);
--
2.24.0
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v1] media: staging: tegra-vde: Use devm_platform_ioremap_resource_byname()
2020-02-27 18:09 [PATCH v1] media: staging: tegra-vde: Use devm_platform_ioremap_resource_byname() Dmitry Osipenko
@ 2020-03-02 8:04 ` Dan Carpenter
2020-03-02 15:04 ` Dmitry Osipenko
0 siblings, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2020-03-02 8:04 UTC (permalink / raw)
To: Dmitry Osipenko
Cc: Thierry Reding, Jonathan Hunter, Mauro Carvalho Chehab,
Hans Verkuil, linux-tegra, devel, linux-kernel, linux-media
On Thu, Feb 27, 2020 at 09:09:15PM +0300, Dmitry Osipenko wrote:
> This helps to make code cleaner a tad.
Please don't start the commit message in the middle of a sentence.
It looks like this for some of us:
https://marc.info/?l=linux-driver-devel&m=158282701430176&w=2
I generally read the subject or the full commit message but seldom
both.
Otherwise the patch looks very good.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v1] media: staging: tegra-vde: Use devm_platform_ioremap_resource_byname()
2020-03-02 8:04 ` Dan Carpenter
@ 2020-03-02 15:04 ` Dmitry Osipenko
2020-03-02 15:20 ` Dan Carpenter
0 siblings, 1 reply; 4+ messages in thread
From: Dmitry Osipenko @ 2020-03-02 15:04 UTC (permalink / raw)
To: Dan Carpenter
Cc: Thierry Reding, Jonathan Hunter, Mauro Carvalho Chehab,
Hans Verkuil, linux-tegra, devel, linux-kernel, linux-media
02.03.2020 11:04, Dan Carpenter пишет:
> On Thu, Feb 27, 2020 at 09:09:15PM +0300, Dmitry Osipenko wrote:
>> This helps to make code cleaner a tad.
>
> Please don't start the commit message in the middle of a sentence.
Could you please clarify what do you mean by the "middle of a sentence"?
The commit's message doesn't sound "middle" to me at all.
> It looks like this for some of us:
>
> https://marc.info/?l=linux-driver-devel&m=158282701430176&w=2
This link points to this patch, I don't quite understand what you're
trying to convey here.
> I generally read the subject or the full commit message but seldom
> both.
The commit's title describes the change briefly, while the message gives
a rational for the change. Usually reviewer should consult the code
changes themselves for more details.
Do you have some kind of a email filter that shows only the commit's
message? Otherwise I'm not sure what's the problem.
> Otherwise the patch looks very good.
Thanks
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v1] media: staging: tegra-vde: Use devm_platform_ioremap_resource_byname()
2020-03-02 15:04 ` Dmitry Osipenko
@ 2020-03-02 15:20 ` Dan Carpenter
0 siblings, 0 replies; 4+ messages in thread
From: Dan Carpenter @ 2020-03-02 15:20 UTC (permalink / raw)
To: Dmitry Osipenko
Cc: devel, linux-kernel, Jonathan Hunter, Hans Verkuil,
Thierry Reding, linux-tegra, Mauro Carvalho Chehab, linux-media
On Mon, Mar 02, 2020 at 06:04:20PM +0300, Dmitry Osipenko wrote:
> 02.03.2020 11:04, Dan Carpenter пишет:
> > On Thu, Feb 27, 2020 at 09:09:15PM +0300, Dmitry Osipenko wrote:
> >> This helps to make code cleaner a tad.
> >
> > Please don't start the commit message in the middle of a sentence.
>
> Could you please clarify what do you mean by the "middle of a sentence"?
> The commit's message doesn't sound "middle" to me at all.
>
> > It looks like this for some of us:
> >
> > https://marc.info/?l=linux-driver-devel&m=158282701430176&w=2
>
> This link points to this patch, I don't quite understand what you're
> trying to convey here.
>
> > I generally read the subject or the full commit message but seldom
> > both.
>
> The commit's title describes the change briefly, while the message gives
> a rational for the change. Usually reviewer should consult the code
> changes themselves for more details.
>
> Do you have some kind of a email filter that shows only the commit's
> message? Otherwise I'm not sure what's the problem.
The commit message just says "This helps to make code cleaner a tad."
but it doesn't mention devm_platform_ioremap_resource_byname(). That
information is there in the subject but not in the commit message itself.
Take a look at the link I sent you and try to find the subject. It's
far away from the commit message.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2020-03-02 15:22 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-27 18:09 [PATCH v1] media: staging: tegra-vde: Use devm_platform_ioremap_resource_byname() Dmitry Osipenko
2020-03-02 8:04 ` Dan Carpenter
2020-03-02 15:04 ` Dmitry Osipenko
2020-03-02 15:20 ` Dan Carpenter
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).