From: "André Draszik" <andre.draszik@linaro.org>
To: "Chanwoo Choi" <cw00.choi@samsung.com>,
"Krzysztof Kozlowski" <krzk@kernel.org>,
"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
"Joel Stanley" <joel@jms.id.au>,
"Andrew Jeffery" <andrew@codeconstruct.com.au>,
"Hans Ulli Kroll" <ulli.kroll@googlemail.com>,
"Linus Walleij" <linus.walleij@linaro.org>,
"Neil Armstrong" <neil.armstrong@linaro.org>,
"Kevin Hilman" <khilman@baylibre.com>,
"Jerome Brunet" <jbrunet@baylibre.com>,
"Martin Blumenstingl" <martin.blumenstingl@googlemail.com>,
"Tóth János" <gomba007@gmail.com>,
"Dianlong Li" <long17.cool@163.com>
Cc: linux-kernel@vger.kernel.org, linux-rtc@vger.kernel.org,
linux-samsung-soc@vger.kernel.org,
linux-arm-kernel@lists.infradead.org,
linux-aspeed@lists.ozlabs.org, linux-amlogic@lists.infradead.org,
"André Draszik" <andre.draszik@linaro.org>
Subject: [PATCH 02/18] rtc: s5m: drop needless struct s5m_rtc_info::i2c member
Date: Fri, 28 Feb 2025 14:07:15 +0000 [thread overview]
Message-ID: <20250228-rtc-cleanups-v1-2-b44cec078481@linaro.org> (raw)
In-Reply-To: <20250228-rtc-cleanups-v1-0-b44cec078481@linaro.org>
When this driver was converted to using the devres managed i2c device
in commit 7db7ad0817fe ("rtc: s5m: use devm_i2c_new_dummy_device()"),
struct s5m_rtc_info::i2c became essentially unused.
We can drop it from the structure and just use a local temporary
variable, reducing runtime memory consumption by a few bytes.
Signed-off-by: André Draszik <andre.draszik@linaro.org>
---
drivers/rtc/rtc-s5m.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/rtc/rtc-s5m.c b/drivers/rtc/rtc-s5m.c
index 36acca5b2639e272dd9baed06ea5582f635702b0..77dd61c30681b8f0a2f23063ad5f7eb52f5b7158 100644
--- a/drivers/rtc/rtc-s5m.c
+++ b/drivers/rtc/rtc-s5m.c
@@ -146,7 +146,6 @@ static const struct s5m_rtc_reg_config s2mps15_rtc_regs = {
struct s5m_rtc_info {
struct device *dev;
- struct i2c_client *i2c;
struct sec_pmic_dev *s5m87xx;
struct regmap *regmap;
struct rtc_device *rtc_dev;
@@ -640,6 +639,7 @@ static int s5m_rtc_probe(struct platform_device *pdev)
{
struct sec_pmic_dev *s5m87xx = dev_get_drvdata(pdev->dev.parent);
struct s5m_rtc_info *info;
+ struct i2c_client *i2c;
const struct regmap_config *regmap_cfg;
int ret, alarm_irq;
@@ -675,14 +675,14 @@ static int s5m_rtc_probe(struct platform_device *pdev)
return -ENODEV;
}
- info->i2c = devm_i2c_new_dummy_device(&pdev->dev, s5m87xx->i2c->adapter,
- RTC_I2C_ADDR);
- if (IS_ERR(info->i2c)) {
+ i2c = devm_i2c_new_dummy_device(&pdev->dev, i2c->adapter,
+ RTC_I2C_ADDR);
+ if (IS_ERR(i2c)) {
dev_err(&pdev->dev, "Failed to allocate I2C for RTC\n");
- return PTR_ERR(info->i2c);
+ return PTR_ERR(i2c);
}
- info->regmap = devm_regmap_init_i2c(info->i2c, regmap_cfg);
+ info->regmap = devm_regmap_init_i2c(i2c, regmap_cfg);
if (IS_ERR(info->regmap)) {
ret = PTR_ERR(info->regmap);
dev_err(&pdev->dev, "Failed to allocate RTC register map: %d\n",
--
2.48.1.711.g2feabab25a-goog
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
next prev parent reply other threads:[~2025-02-28 14:12 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-28 14:07 [PATCH 00/18] a few rtc driver cleanups André Draszik
2025-02-28 14:07 ` [PATCH 01/18] rtc: max77686: drop needless struct max77686_rtc_info::rtc member André Draszik
2025-02-28 17:30 ` Krzysztof Kozlowski
2025-02-28 14:07 ` André Draszik [this message]
2025-02-28 17:31 ` [PATCH 02/18] rtc: s5m: drop needless struct s5m_rtc_info::i2c member Krzysztof Kozlowski
2025-03-01 17:47 ` kernel test robot
2025-02-28 14:07 ` [PATCH 03/18] rtc: aspeed: drop needless struct aspeed_rtc::rtc_dev member André Draszik
2025-03-18 0:58 ` Andrew Jeffery
2025-02-28 14:07 ` [PATCH 04/18] rtc: ds2404: drop needless struct ds2404::rtc member André Draszik
2025-02-28 14:07 ` [PATCH 05/18] rtc: ep93xx: drop needless struct ep93xx_rtc::rtc member André Draszik
2025-02-28 14:07 ` [PATCH 06/18] rtc: ftrtc010: drop needless struct ftrtc010_rtc::rtc_dev member André Draszik
2025-03-01 18:12 ` Linus Walleij
2025-02-28 14:07 ` [PATCH 07/18] rtc: m48t86: drop needless struct m48t86_rtc_info::rtc member André Draszik
2025-02-28 14:07 ` [PATCH 08/18] rtc: meson: drop needless struct meson_rtc::rtc member André Draszik
2025-02-28 14:07 ` [PATCH 09/18] rtc: meson-vrtc: drop needless struct meson_vrtc_data::rtc member André Draszik
2025-02-28 14:07 ` [PATCH 10/18] rtc: pl030: drop needless struct pl030_rtc::rtc member André Draszik
2025-03-01 18:11 ` Linus Walleij
2025-02-28 14:07 ` [PATCH 11/18] rtc: rx8581: drop needless struct rx8581::rtc member André Draszik
2025-02-28 14:07 ` [PATCH 12/18] rtc: s35390a: drop needless struct s35390a::rtc member André Draszik
2025-02-28 14:07 ` [PATCH 13/18] rtc: sd2405al: drop needless struct sd2405al::rtc member André Draszik
2025-03-03 14:04 ` Tóth János
2025-02-28 14:07 ` [PATCH 14/18] rtc: sd3078: drop needless struct sd3078::rtc member André Draszik
2025-02-28 14:07 ` [PATCH 15/18] rtc: rx8581: drop needless struct rx8581 André Draszik
2025-02-28 14:07 ` [PATCH 16/18] rtc: sd3078: drop needless struct sd3078 André Draszik
2025-02-28 14:07 ` [PATCH 17/18] rtc: max77686: use dev_err_probe() where appropriate André Draszik
2025-03-01 13:18 ` Krzysztof Kozlowski
2025-02-28 14:07 ` [PATCH 18/18] rtc: s5m: convert to " André Draszik
2025-03-01 13:19 ` Krzysztof Kozlowski
2025-03-01 20:36 ` [PATCH 00/18] a few rtc driver cleanups Alexandre Belloni
2025-03-03 8:45 ` André Draszik
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=20250228-rtc-cleanups-v1-2-b44cec078481@linaro.org \
--to=andre.draszik@linaro.org \
--cc=alexandre.belloni@bootlin.com \
--cc=andrew@codeconstruct.com.au \
--cc=cw00.choi@samsung.com \
--cc=gomba007@gmail.com \
--cc=jbrunet@baylibre.com \
--cc=joel@jms.id.au \
--cc=khilman@baylibre.com \
--cc=krzk@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-amlogic@lists.infradead.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-aspeed@lists.ozlabs.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rtc@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=long17.cool@163.com \
--cc=martin.blumenstingl@googlemail.com \
--cc=neil.armstrong@linaro.org \
--cc=ulli.kroll@googlemail.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
all inboxes | Powered by JetHome®