From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Wolfram Sang <wsa@the-dreams.de>
Cc: Wolfram Sang <wsa+renesas@sang-engineering.com>,
linux-kernel@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
kernel-janitors@vger.kernel.org,
Vladimir Zapolskiy <vz@mleia.com>,
Sylvain Lemieux <slemieux.tyco@gmail.com>,
Rakesh Iyer <riyer@nvidia.com>,
Laxman Dewangan <ldewangan@nvidia.com>,
Thierry Reding <thierry.reding@gmail.com>,
Jonathan Hunter <jonathanh@nvidia.com>,
linux-input@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-tegra@vger.kernel.org
Subject: Re: [PATCH 20/61] input: keyboard: simplify getting .drvdata
Date: Thu, 26 Apr 2018 14:23:27 -0700 [thread overview]
Message-ID: <20180426212327.GB210716@dtor-ws> (raw)
In-Reply-To: <20180426200401.lvqiy4gnchkwr4qw@ninjato>
On Thu, Apr 26, 2018 at 10:04:01PM +0200, Wolfram Sang wrote:
> Hi Dmitry,
>
> > > We should get drvdata from struct device directly. Going via
> > > platform_device is an unneeded step back and forth.
> >
> > I consider the fact that platform device's driver data is accessible via
> > device driver data being implementation detail that may or may not change
>
> Isn't it actually the other way around? platform_get_drvdata() is a
> convenience function to access driver_data which is embedded in struct
> device?
I guess it depends on how you read it. I always considered it separate
because none (?) of the bus implementation assert this in comments to
XXX_get_drvdata().
>
> > in the future, so I'd prefer keep using the proper accessors for the
> > objects we are dealing with.
>
> Exactly. I'd just argue, the object we are dealing with, declared in the
> PM functions, is a struct device.
No, the driver does not create a generic device, it actually creates a
platform device, or i2c client, or spi, or something else. The fact that
suspend and resume routines have generic device as their argument has
more to do with the language limitation rather than reflection of true
type of the objects we are dealing with.
Thanks.
--
Dmitry
next prev parent reply other threads:[~2018-04-26 21:23 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-19 14:05 [PATCH 00/61] tree-wide: simplify getting .drvdata Wolfram Sang
2018-04-19 14:05 ` [PATCH 17/61] hid: " Wolfram Sang
2018-04-19 14:05 ` [PATCH 20/61] input: keyboard: " Wolfram Sang
2018-04-26 19:19 ` Dmitry Torokhov
2018-04-26 20:04 ` Wolfram Sang
2018-04-26 21:23 ` Dmitry Torokhov [this message]
2018-04-27 10:20 ` Wolfram Sang
2018-04-19 14:05 ` [PATCH 21/61] input: misc: " Wolfram Sang
2018-04-19 14:05 ` [PATCH 22/61] input: mouse: " Wolfram Sang
2018-04-19 14:05 ` [PATCH 23/61] input: touchscreen: " Wolfram Sang
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=20180426212327.GB210716@dtor-ws \
--to=dmitry.torokhov@gmail.com \
--cc=jonathanh@nvidia.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=ldewangan@nvidia.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=riyer@nvidia.com \
--cc=slemieux.tyco@gmail.com \
--cc=thierry.reding@gmail.com \
--cc=vz@mleia.com \
--cc=wsa+renesas@sang-engineering.com \
--cc=wsa@the-dreams.de \
/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).