Skip to content

Commit e535af5

Browse files
chleroywsakernel
authored andcommitted
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>
1 parent db63eac commit e535af5

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/i2c/busses/i2c-cpm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -658,7 +658,7 @@ static int cpm_i2c_probe(struct platform_device *ofdev)
658658
/* register new adapter to i2c module... */
659659

660660
data = of_get_property(ofdev->dev.of_node, "linux,i2c-index", &len);
661-
cpm->adap.nr = (data && len == 4) ? be32_to_cpup(data) : -1;
661+
cpm->adap.nr = (data && len == 4) ? *data : -1;
662662
result = i2c_add_numbered_adapter(&cpm->adap);
663663

664664
if (result < 0)

0 commit comments

Comments
 (0)