From: Jonathan Cameron <jic23@kernel.org>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Jarkko Nikula <jarkko.nikula@linux.intel.com>,
linux-iio <linux-iio@vger.kernel.org>,
William Breathitt Gray <vilhelm.gray@gmail.com>
Subject: Re: [PATCH 2/2] counter: intel-qep: Use to_pci_dev() helper
Date: Sun, 13 Jun 2021 12:08:45 +0100 [thread overview]
Message-ID: <20210613120845.48160e47@jic23-huawei> (raw)
In-Reply-To: <CAHp75VfBoOvGp7O3-WSWFuXGbQP0EbSQYaJi5B28oBkazkV8+w@mail.gmail.com>
On Sun, 13 Jun 2021 13:36:16 +0300
Andy Shevchenko <andy.shevchenko@gmail.com> wrote:
> On Fri, Jun 11, 2021 at 2:57 PM Jarkko Nikula
> <jarkko.nikula@linux.intel.com> wrote:
> >
> > Use to_pci_dev() helper instead of container_of(d, struct pci_dev, dev);
>
> ...
>
> > - struct pci_dev *pdev = container_of(dev, struct pci_dev, dev);
> > + struct pci_dev *pdev = to_pci_dev(dev);
> > struct intel_qep *qep = pci_get_drvdata(pdev);
>
> Why not change both lines to dev_get_drvdata()?
>
> > - struct pci_dev *pdev = container_of(dev, struct pci_dev, dev);
> > + struct pci_dev *pdev = to_pci_dev(dev);
> > struct intel_qep *qep = pci_get_drvdata(pdev);
>
> Ditto
>
Question when doing this is whether it is better to pair pci_get_drvdata
with pci_set_drvdata rather than assuming it will always map to dev_get_drvdata().
I personally don't feel too strongly about this either way, but I know
others are unhappy with mixing them.
Of course, could use dev_set_drvdata() in the first place then it would be less
of an issue.
Jonathan
next prev parent reply other threads:[~2021-06-13 11:06 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-11 11:55 [PATCH 1/2] counter: intel-qep: Mark PM callbacks with __maybe_unused Jarkko Nikula
2021-06-11 11:55 ` [PATCH 2/2] counter: intel-qep: Use to_pci_dev() helper Jarkko Nikula
2021-06-13 10:36 ` Andy Shevchenko
2021-06-13 11:08 ` Jonathan Cameron [this message]
2021-06-14 8:24 ` Jarkko Nikula
2021-06-14 8:57 ` Andy Shevchenko
2021-06-14 9:37 ` Uwe Kleine-König
2021-06-14 10:47 ` Jonathan Cameron
2021-06-14 11:10 ` Andy Shevchenko
2021-06-11 17:23 ` [PATCH 1/2] counter: intel-qep: Mark PM callbacks with __maybe_unused Jonathan Cameron
2021-06-12 0:45 ` William Breathitt Gray
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=20210613120845.48160e47@jic23-huawei \
--to=jic23@kernel.org \
--cc=andy.shevchenko@gmail.com \
--cc=jarkko.nikula@linux.intel.com \
--cc=linux-iio@vger.kernel.org \
--cc=vilhelm.gray@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