From: Rosen Penev <rosenp@gmail.com>
To: linux-i2c@vger.kernel.org
Cc: Chris Packham <chris.packham@alliedtelesis.co.nz>,
Andi Shyti <andi.shyti@kernel.org>,
linux-kernel@vger.kernel.org (open list)
Subject: [PATCH 1/2] i2c: rtl9300: remove const cast
Date: Tue, 16 Dec 2025 22:30:26 -0800 [thread overview]
Message-ID: <20251217063027.37987-2-rosenp@gmail.com> (raw)
In-Reply-To: <20251217063027.37987-1-rosenp@gmail.com>
These casts are used to remove const for no good reason. Fix the types
instead.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
---
drivers/i2c/busses/i2c-rtl9300.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/i2c/busses/i2c-rtl9300.c b/drivers/i2c/busses/i2c-rtl9300.c
index 4723e48cfe18..f2aa341a7cdd 100644
--- a/drivers/i2c/busses/i2c-rtl9300.c
+++ b/drivers/i2c/busses/i2c-rtl9300.c
@@ -129,7 +129,7 @@ static int rtl9310_i2c_select_scl(struct rtl9300_i2c *i2c, u8 scl)
static int rtl9300_i2c_config_chan(struct rtl9300_i2c *i2c, struct rtl9300_i2c_chan *chan)
{
- struct rtl9300_i2c_drv_data *drv_data;
+ const struct rtl9300_i2c_drv_data *drv_data;
int ret;
if (i2c->sda_num == chan->sda_num)
@@ -139,7 +139,7 @@ static int rtl9300_i2c_config_chan(struct rtl9300_i2c *i2c, struct rtl9300_i2c_c
if (ret)
return ret;
- drv_data = (struct rtl9300_i2c_drv_data *)device_get_match_data(i2c->dev);
+ drv_data = device_get_match_data(i2c->dev);
ret = drv_data->select_scl(i2c, i2c->scl_num);
if (ret)
return ret;
@@ -372,7 +372,7 @@ static int rtl9300_i2c_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev;
struct rtl9300_i2c *i2c;
struct fwnode_handle *child;
- struct rtl9300_i2c_drv_data *drv_data;
+ const struct rtl9300_i2c_drv_data *drv_data;
struct reg_field fields[F_NUM_FIELDS];
u32 clock_freq, scl_num, sda_num;
int ret, i = 0;
@@ -399,7 +399,7 @@ static int rtl9300_i2c_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, i2c);
- drv_data = (struct rtl9300_i2c_drv_data *)device_get_match_data(i2c->dev);
+ drv_data = device_get_match_data(i2c->dev);
if (device_get_child_node_count(dev) > drv_data->max_nchan)
return dev_err_probe(dev, -EINVAL, "Too many channels\n");
--
2.52.0
next prev parent reply other threads:[~2025-12-17 6:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-12-17 6:30 [PATCH 0/2] i2c: rtl9300: two cleanups Rosen Penev
2025-12-17 6:30 ` Rosen Penev [this message]
2025-12-17 19:39 ` [PATCH 1/2] i2c: rtl9300: remove const cast Chris Packham
2025-12-17 6:30 ` [PATCH 2/2] i2c: rtl9300: use of instead of fwnode Rosen Penev
2025-12-17 19:43 ` Chris Packham
2025-12-17 20:11 ` Rosen Penev
2026-01-15 17:34 ` [PATCH 0/2] i2c: rtl9300: two cleanups Andi Shyti
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=20251217063027.37987-2-rosenp@gmail.com \
--to=rosenp@gmail.com \
--cc=andi.shyti@kernel.org \
--cc=chris.packham@alliedtelesis.co.nz \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
/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