From: Lee Jones <lee@kernel.org>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Jarkko Nikula <jarkko.nikula@linux.intel.com>,
Chen Ni <nichen@iscas.ac.cn>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 1/2] mfd: intel-lpss: Use PCI APIs instead of derefereincing
Date: Thu, 23 Nov 2023 11:17:51 +0000 [thread overview]
Message-ID: <20231123111751.GB1243364@google.com> (raw)
In-Reply-To: <20231106184052.1166579-2-andriy.shevchenko@linux.intel.com>
On Mon, 06 Nov 2023, Andy Shevchenko wrote:
> We have a few PCI APIs that may be used instead of direct dereferencibg,
> Using them will also provide better error codes.
>
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> ---
> drivers/mfd/intel-lpss-pci.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
Please use spell-check on your commit messages.
Let's not get complacent.
> diff --git a/drivers/mfd/intel-lpss-pci.c b/drivers/mfd/intel-lpss-pci.c
> index ae5759200622..cf56cd3a40ee 100644
> --- a/drivers/mfd/intel-lpss-pci.c
> +++ b/drivers/mfd/intel-lpss-pci.c
> @@ -37,13 +37,17 @@ static int intel_lpss_pci_probe(struct pci_dev *pdev,
> if (ret)
> return ret;
>
> + ret = pci_alloc_irq_vectors(pdev, 1, 1, PCI_IRQ_LEGACY);
> + if (ret)
> + return ret;
> +
> info = devm_kmemdup(&pdev->dev, (void *)id->driver_data, sizeof(*info),
> GFP_KERNEL);
> if (!info)
> return -ENOMEM;
>
> - info->mem = &pdev->resource[0];
> - info->irq = pdev->irq;
> + info->mem = pci_resource_n(pdev, 0);
> + info->irq = pci_irq_vector(pdev, 0);
>
> if (pci_match_id(ignore_resource_conflicts_ids, pdev))
> info->ignore_resource_conflicts = true;
> --
> 2.40.0.1.gaa8946217a0b
>
--
Lee Jones [李琼斯]
next prev parent reply other threads:[~2023-11-23 11:18 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-06 18:40 [PATCH v3 0/2] mfd: intel-lpss: refactor PCI probe and common IRQ check Andy Shevchenko
2023-11-06 18:40 ` [PATCH v3 1/2] mfd: intel-lpss: Use PCI APIs instead of derefereincing Andy Shevchenko
2023-11-23 11:17 ` Lee Jones [this message]
2023-11-06 18:40 ` [PATCH v3 2/2] mfd: intel-lpss: Amend IRQ check Andy Shevchenko
2023-11-23 11:18 ` Lee Jones
2023-11-23 11:17 ` [PATCH v3 0/2] mfd: intel-lpss: refactor PCI probe and common " 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=20231123111751.GB1243364@google.com \
--to=lee@kernel.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=jarkko.nikula@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=nichen@iscas.ac.cn \
/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.