[PATCH 1/6] mmc: sdhci-pltfm: Add structure for host-specific data
Anton Vorontsov
cbouatmailru at gmail.com
Thu Sep 30 07:09:22 EDT 2010
On Thu, Sep 30, 2010 at 12:19:38PM +0200, Wolfram Sang wrote:
[...]
> > You're right it wouldn't. But isn't it a bit risky even if you could access it,
> > in the long the platform_data coild point to something that is in the __devinit section
> > or similar?
>
> The use-case we see now is in the custom init() call, i.e. setting up
> GPIO, enabling clocks. That is in the same section. Accessing
> platform_data later is in deed always risky and should not be done,
> sdhci-pltfm is no special case here.
I don't think that it's always risky, it's more driver-specific.
Many drivers access it from everywhere, see drivers/mmc/host/mmc_spi.c
for example. In general, if the driver needs most of the platform data
in the run-time, it makes no sense to duplicate or copy the pdata into
the private struct field by field.
Thanks,
--
Anton Vorontsov
email: cbouatmailru at gmail.com
irc://irc.freenode.net/bd2
More information about the linux-arm-kernel
mailing list