summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorChristophe Leroy <christophe.leroy@csgroup.eu>2023-12-07 01:24:03 +0300
committerWolfram Sang <wsa@kernel.org>2024-01-18 23:10:42 +0300
commite535af5c4225fe2715d12322b645853ab9724648 (patch)
treef5fb141ec7eb3dcf9174a2e8d39b9eca6b86bdfa /drivers
parentdb63eacdf61d6bbcde783f15aaafbd8e66476e9a (diff)
downloadlinux-e535af5c4225fe2715d12322b645853ab9724648.tar.xz
i2c: cpm: Remove linux,i2c-index conversion from be32
sparse reports an error on some data that gets converted from be32. That's because that data is typed u32 instead of __be32. The type is correct, the be32_to_cpu() conversion is not. Remove the conversion. Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202312042210.QL4DA8Av-lkp@intel.com/ Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu> Acked-By: Jochen Friedrich <jochen@scram.de> Reviewed-by: Andi Shyti <andi.shyti@kernel.org> Signed-off-by: Wolfram Sang <wsa@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/i2c/busses/i2c-cpm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-cpm.c b/drivers/i2c/busses/i2c-cpm.c
index 9a664abf734d..4404b4aac676 100644
--- a/drivers/i2c/busses/i2c-cpm.c
+++ b/drivers/i2c/busses/i2c-cpm.c
@@ -658,7 +658,7 @@ static int cpm_i2c_probe(struct platform_device *ofdev)
/* register new adapter to i2c module... */
data = of_get_property(ofdev->dev.of_node, "linux,i2c-index", &len);
- cpm->adap.nr = (data && len == 4) ? be32_to_cpup(data) : -1;
+ cpm->adap.nr = (data && len == 4) ? *data : -1;
result = i2c_add_numbered_adapter(&cpm->adap);
if (result < 0)