From: "Russell King (Oracle)" <linux@armlinux.org.uk>
To: Andrei Coardos <aboutphysycs@gmail.com>
Cc: linux-kernel@vger.kernel.org, linux-rtc@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
alexandre.belloni@bootlin.com, a.zummo@towertech.it,
sebastian.hesselbarth@gmail.com, gregory.clement@bootlin.com,
andrew@lunn.ch, alex@shruggie.ro
Subject: Re: [PATCH] rtc: armada38x: remove unneeded call to platform_set_drvdata()
Date: Mon, 7 Aug 2023 23:36:28 +0100 [thread overview]
Message-ID: <ZNFx7FfmmrMMZdmv@shell.armlinux.org.uk> (raw)
In-Reply-To: <20230807124811.16763-1-aboutphysycs@gmail.com>
On Mon, Aug 07, 2023 at 03:48:11PM +0300, Andrei Coardos wrote:
> This function call was found to be unnecessary as there is no equivalent
> platform_get_drvdata() call to access the private data of the driver. Also,
> the private data is defined in this driver, so there is no risk of it being
> accessed outside of this driver file.
I hope you're not going about doing this _broken_ thing and thinking
"if there's no platform_get_drvdata(), then there shouldn't be any
platform_set_drvdata()" because that is WRONG. Wrong wrong wrong wrong
wrong.
platform_set_drvdata(pdev, foo);
sets the driver data on dev, and is basically implemented as:
dev_set_drvdata(&pdev->dev, foo);
So, to access the driver data, one can either use:
platform_get_drvdata(pdev)
or:
dev_get_drvdata(dev)
where one is dealing with a "struct device" pointer. So, the lack of
any platform_get_drvdata() does *NOT* mean that platform_set_drvdata()
can be removed.
If that's what you've been doing, you are *creating* bugs - and you
need to stop until you properly understand what you are doing.
Thanks anyway, but... your change is totally wrong and will wreck the
driver, causing it to oops the kernel.
Strong and definite NAK.
I do *NOT* expect to ever see a patch like this again for this driver.
Thanks.
--
RMK's Patch system: https://www.armlinux.org.uk/developer/patches/
FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
prev parent reply other threads:[~2023-08-07 22:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-07 12:48 [PATCH] rtc: armada38x: remove unneeded call to platform_set_drvdata() Andrei Coardos
2023-08-07 17:32 ` Alexandru Ardelean
2023-08-07 22:36 ` Russell King (Oracle) [this message]
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=ZNFx7FfmmrMMZdmv@shell.armlinux.org.uk \
--to=linux@armlinux.org.uk \
--cc=a.zummo@towertech.it \
--cc=aboutphysycs@gmail.com \
--cc=alex@shruggie.ro \
--cc=alexandre.belloni@bootlin.com \
--cc=andrew@lunn.ch \
--cc=gregory.clement@bootlin.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rtc@vger.kernel.org \
--cc=sebastian.hesselbarth@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;
as well as URLs for NNTP newsgroup(s).