Skip to content

Commit aa6c77d

Browse files
marcusfolkessonjic23
authored andcommitted
iio: adc: mcp3911: mask out device ID in debug prints
The Device ID should not be included when printing register. Signed-off-by: Marcus Folkesson <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jonathan Cameron <[email protected]>
1 parent 815f164 commit aa6c77d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/iio/adc/mcp3911.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757

5858
#define MCP3911_REG_READ(reg, id) ((((reg) << 1) | ((id) << 6) | (1 << 0)) & 0xff)
5959
#define MCP3911_REG_WRITE(reg, id) ((((reg) << 1) | ((id) << 6) | (0 << 0)) & 0xff)
60+
#define MCP3911_REG_MASK GENMASK(4, 1)
6061

6162
#define MCP3911_NUM_CHANNELS 2
6263

@@ -89,8 +90,8 @@ static int mcp3911_read(struct mcp3911 *adc, u8 reg, u32 *val, u8 len)
8990

9091
be32_to_cpus(val);
9192
*val >>= ((4 - len) * 8);
92-
dev_dbg(&adc->spi->dev, "reading 0x%x from register 0x%x\n", *val,
93-
reg >> 1);
93+
dev_dbg(&adc->spi->dev, "reading 0x%x from register 0x%lx\n", *val,
94+
FIELD_GET(MCP3911_REG_MASK, reg));
9495
return ret;
9596
}
9697

0 commit comments

Comments
 (0)