linux-amlogic.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: sean@mess.org (Sean Young)
To: linus-amlogic@lists.infradead.org
Subject: [PATCH 1/5] media: rc: meson-ir: remove irq from struct meson_ir
Date: Tue, 11 Apr 2017 16:26:40 +0100	[thread overview]
Message-ID: <20170411152640.GA19451@gofer.mess.org> (raw)
In-Reply-To: <0ef141e3-0eec-fb2f-c575-e236c5dfc9ae@baylibre.com>

On Tue, Apr 11, 2017 at 11:50:45AM +0200, Neil Armstrong wrote:
> On 04/11/2017 07:53 AM, Heiner Kallweit wrote:
> > The irq number is used in the probe function only, therefore just use
> > a local variable.
> > 
> > Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
> > ---
> >  drivers/media/rc/meson-ir.c | 11 +++++------
> >  1 file changed, 5 insertions(+), 6 deletions(-)
> > 
> > diff --git a/drivers/media/rc/meson-ir.c b/drivers/media/rc/meson-ir.c
> > index 5576dbd6..a4128d7c 100644
> > --- a/drivers/media/rc/meson-ir.c
> > +++ b/drivers/media/rc/meson-ir.c
> > @@ -68,7 +68,6 @@
> >  struct meson_ir {
> >  	void __iomem	*reg;
> >  	struct rc_dev	*rc;
> > -	int		irq;
> >  	spinlock_t	lock;
> >  };
> >  
> > @@ -112,7 +111,7 @@ static int meson_ir_probe(struct platform_device *pdev)
> >  	struct resource *res;
> >  	const char *map_name;
> >  	struct meson_ir *ir;
> > -	int ret;
> > +	int irq, ret;
> >  
> >  	ir = devm_kzalloc(dev, sizeof(struct meson_ir), GFP_KERNEL);
> >  	if (!ir)
> > @@ -125,10 +124,10 @@ static int meson_ir_probe(struct platform_device *pdev)
> >  		return PTR_ERR(ir->reg);
> >  	}
> >  
> > -	ir->irq = platform_get_irq(pdev, 0);
> > -	if (ir->irq < 0) {
> > +	irq = platform_get_irq(pdev, 0);
> > +	if (irq < 0) {
> >  		dev_err(dev, "no irq resource\n");
> > -		return ir->irq;
> > +		return irq;
> >  	}
> >  
> >  	ir->rc = rc_allocate_device(RC_DRIVER_IR_RAW);
> > @@ -158,7 +157,7 @@ static int meson_ir_probe(struct platform_device *pdev)
> >  		goto out_free;
> >  	}
> >  
> > -	ret = devm_request_irq(dev, ir->irq, meson_ir_irq, 0, "ir-meson", ir);
> > +	ret = devm_request_irq(dev, irq, meson_ir_irq, 0, "ir-meson", ir);
> >  	if (ret) {
> >  		dev_err(dev, "failed to request irq\n");
> >  		goto out_unreg;
> > 
> 
> Hi Heiner,
> 
> I'm not really convinced this is useful, if somehow for future enhancements we need the IRQ
> number, this will need to be reverted...

It's bad form having unused members in a struct, and if it really is needed
in some future enhancement, it is easily reintroduced in that future
enhancement patch.


Sean

  reply	other threads:[~2017-04-11 15:26 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-11  5:51 [PATCH 0/5] media: rc: meson-ir: series with smaller improvements Heiner Kallweit
2017-04-11  5:53 ` [PATCH 1/5] media: rc: meson-ir: remove irq from struct meson_ir Heiner Kallweit
2017-04-11  9:50   ` Neil Armstrong
2017-04-11 15:26     ` Sean Young [this message]
2017-04-11  6:00 ` [PATCH 2/5] media: rc: meson-ir: make use of the bitfield macros Heiner Kallweit
2017-04-11  7:14   ` Neil Armstrong
2017-04-11  6:02 ` [PATCH 3/5] media: rc: meson-ir: switch to managed rc device allocation / registration Heiner Kallweit
2017-04-11  7:15   ` Neil Armstrong
2017-04-11  6:05 ` [PATCH 4/5] media: rc: meson-ir: use readl_relaxed in the interrupt handler Heiner Kallweit
2017-04-11  7:15   ` Neil Armstrong
2017-04-11  6:07 ` [PATCH 5/5] media: rc: meson-ir: change irq name to to of node name Heiner Kallweit

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=20170411152640.GA19451@gofer.mess.org \
    --to=sean@mess.org \
    --cc=linus-amlogic@lists.infradead.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
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;
as well as URLs for NNTP newsgroup(s).