All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Lee Jones <lee.jones@linaro.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 2/2] mfd: intel_quark_i2c_gpio: enable MSI interrupt
Date: Wed, 24 Mar 2021 12:39:23 +0200	[thread overview]
Message-ID: <YFsW26BH1LZM9ZBs@smile.fi.intel.com> (raw)
In-Reply-To: <20210324102931.GH2916463@dell>

On Wed, Mar 24, 2021 at 10:29:31AM +0000, Lee Jones wrote:
> On Tue, 23 Mar 2021, Andy Shevchenko wrote:
> 
> > Allow interrupts to be MSI if supported by hardware.
> > 
> > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > ---
> > v2: new patch
> >  drivers/mfd/intel_quark_i2c_gpio.c | 21 +++++++++++++++------
> >  1 file changed, 15 insertions(+), 6 deletions(-)
> > 
> > diff --git a/drivers/mfd/intel_quark_i2c_gpio.c b/drivers/mfd/intel_quark_i2c_gpio.c
> > index 52728a963c17..16ce9cb3aa2f 100644
> > --- a/drivers/mfd/intel_quark_i2c_gpio.c
> > +++ b/drivers/mfd/intel_quark_i2c_gpio.c
> > @@ -169,8 +169,8 @@ static int intel_quark_i2c_setup(struct pci_dev *pdev, struct mfd_cell *cell)
> >  	res[INTEL_QUARK_IORES_MEM].end =
> >  		pci_resource_end(pdev, MFD_I2C_BAR);
> >  
> > -	res[INTEL_QUARK_IORES_IRQ].start = pdev->irq;
> > -	res[INTEL_QUARK_IORES_IRQ].end = pdev->irq;
> > +	res[INTEL_QUARK_IORES_IRQ].start = pci_irq_vector(pdev, 0);
> > +	res[INTEL_QUARK_IORES_IRQ].end = pci_irq_vector(pdev, 0);
> >  
> >  	pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL);
> >  	if (!pdata)
> > @@ -217,7 +217,7 @@ static int intel_quark_gpio_setup(struct pci_dev *pdev, struct mfd_cell *cell)
> >  	pdata->properties->idx		= 0;
> >  	pdata->properties->ngpio	= INTEL_QUARK_MFD_NGPIO;
> >  	pdata->properties->gpio_base	= INTEL_QUARK_MFD_GPIO_BASE;
> > -	pdata->properties->irq[0]	= pdev->irq;
> > +	pdata->properties->irq[0]	= pci_irq_vector(pdev, 0);
> >  
> >  	cell->platform_data = pdata;
> >  	cell->pdata_size = sizeof(*pdata);
> > @@ -245,22 +245,30 @@ static int intel_quark_mfd_probe(struct pci_dev *pdev,
> >  	if (ret)
> >  		return ret;
> >  
> > +	pci_set_master(pdev);
> > +
> > +	ret = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_ALL_TYPES);
> 
> Is there any way these magic number can be defined or sizeof()'ed?

Grep for it in the kernel, it's rarely defined.

The semantic is min-max range and having two defines (*) here for these seems
to me as an utter overkill.

Of course, if you insist I may do it.

*) since value is the same, we might have one definition, but it will be even
   more confusion to have it as a min and max at the same time.

-- 
With Best Regards,
Andy Shevchenko



  reply	other threads:[~2021-03-24 10:40 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-23 12:34 [PATCH v2 1/2] mfd: intel_quark_i2c_gpio: Reuse BAR definitions for MFD cell indexing Andy Shevchenko
2021-03-23 12:34 ` [PATCH v2 2/2] mfd: intel_quark_i2c_gpio: enable MSI interrupt Andy Shevchenko
2021-03-24 10:29   ` Lee Jones
2021-03-24 10:39     ` Andy Shevchenko [this message]
2021-03-24 10:47       ` Lee Jones
2021-03-24 11:20         ` Andy Shevchenko
2021-03-24 11:50           ` Lee Jones
2021-03-24 12:26             ` Andy Shevchenko
2021-03-24 13:07               ` Lee Jones
2021-03-24 14:20                 ` Andy Shevchenko
2021-03-24 15:10                   ` Lee Jones
2021-03-24 15:20                     ` Andy Shevchenko
2021-03-24 10:29 ` [PATCH v2 1/2] mfd: intel_quark_i2c_gpio: Reuse BAR definitions for MFD cell indexing Lee Jones

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=YFsW26BH1LZM9ZBs@smile.fi.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.