From: akshay bansod <akshaybansod997@gmail.com>
To: "Lars-Peter Clausen" <lars@metafoo.de>,
"Michael Hennerich" <Michael.Hennerich@analog.com>,
"Jonathan Cameron" <jic23@kernel.org>,
"David Lechner" <dlechner@baylibre.com>,
"Nuno Sá" <nuno.sa@analog.com>,
"Andy Shevchenko" <andy@kernel.org>,
"Linus Walleij" <linus.walleij@linaro.org>,
"Bartosz Golaszewski" <brgl@bgdev.pl>
Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-gpio@vger.kernel.org
Subject: [PATCH] iio: dac: ad559*: fixed coding style issue (shorthand unsigned)
Date: Sat, 3 May 2025 15:25:29 +0530 [thread overview]
Message-ID: <20250503095532.132041-1-akshaybansod997@gmail.com> (raw)
checkpatch.pl flagged use of shorthand 'unsigned' as warning
trivial fix: replaced use of shorthand 'unsigned' with 'unsigned int'
Signed-off-by: akshay bansod <akshaybansod997@gmail.com>
---
drivers/iio/dac/ad5592r-base.c | 14 +++++++-------
drivers/iio/dac/ad5592r-base.h | 4 ++--
drivers/iio/dac/ad5592r.c | 4 ++--
drivers/iio/dac/ad5593r.c | 5 +++--
4 files changed, 14 insertions(+), 13 deletions(-)
diff --git a/drivers/iio/dac/ad5592r-base.c b/drivers/iio/dac/ad5592r-base.c
index 5f2cd5172..9aa051a74 100644
--- a/drivers/iio/dac/ad5592r-base.c
+++ b/drivers/iio/dac/ad5592r-base.c
@@ -21,7 +21,7 @@
#include "ad5592r-base.h"
-static int ad5592r_gpio_get(struct gpio_chip *chip, unsigned offset)
+static int ad5592r_gpio_get(struct gpio_chip *chip, unsigned int offset)
{
struct ad5592r_state *st = gpiochip_get_data(chip);
int ret = 0;
@@ -55,7 +55,7 @@ static int ad5592r_gpio_set(struct gpio_chip *chip, unsigned int offset,
return st->ops->reg_write(st, AD5592R_REG_GPIO_SET, st->gpio_val);
}
-static int ad5592r_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
+static int ad5592r_gpio_direction_input(struct gpio_chip *chip, unsigned int offset)
{
struct ad5592r_state *st = gpiochip_get_data(chip);
int ret;
@@ -73,7 +73,7 @@ static int ad5592r_gpio_direction_input(struct gpio_chip *chip, unsigned offset)
}
static int ad5592r_gpio_direction_output(struct gpio_chip *chip,
- unsigned offset, int value)
+ unsigned int offset, int value)
{
struct ad5592r_state *st = gpiochip_get_data(chip);
int ret;
@@ -99,7 +99,7 @@ static int ad5592r_gpio_direction_output(struct gpio_chip *chip,
return st->ops->reg_write(st, AD5592R_REG_GPIO_IN_EN, st->gpio_in);
}
-static int ad5592r_gpio_request(struct gpio_chip *chip, unsigned offset)
+static int ad5592r_gpio_request(struct gpio_chip *chip, unsigned int offset)
{
struct ad5592r_state *st = gpiochip_get_data(chip);
@@ -188,7 +188,7 @@ static int ad5592r_set_channel_modes(struct ad5592r_state *st)
{
const struct ad5592r_rw_ops *ops = st->ops;
int ret;
- unsigned i;
+ unsigned int i;
u8 pulldown = 0, tristate = 0, dac = 0, adc = 0;
u16 read_back;
@@ -472,7 +472,7 @@ static const struct iio_chan_spec_ext_info ad5592r_ext_info[] = {
};
static void ad5592r_setup_channel(struct iio_dev *iio_dev,
- struct iio_chan_spec *chan, bool output, unsigned id)
+ struct iio_chan_spec *chan, bool output, unsigned int id)
{
chan->type = IIO_VOLTAGE;
chan->indexed = 1;
@@ -489,7 +489,7 @@ static void ad5592r_setup_channel(struct iio_dev *iio_dev,
static int ad5592r_alloc_channels(struct iio_dev *iio_dev)
{
struct ad5592r_state *st = iio_priv(iio_dev);
- unsigned i, curr_channel = 0,
+ unsigned int i, curr_channel = 0,
num_channels = st->num_channels;
struct iio_chan_spec *channels;
struct fwnode_handle *child;
diff --git a/drivers/iio/dac/ad5592r-base.h b/drivers/iio/dac/ad5592r-base.h
index cc7be426c..d78f5bb72 100644
--- a/drivers/iio/dac/ad5592r-base.h
+++ b/drivers/iio/dac/ad5592r-base.h
@@ -42,8 +42,8 @@ enum ad5592r_registers {
#define AD5592R_REG_CTRL_DAC_RANGE BIT(4)
struct ad5592r_rw_ops {
- int (*write_dac)(struct ad5592r_state *st, unsigned chan, u16 value);
- int (*read_adc)(struct ad5592r_state *st, unsigned chan, u16 *value);
+ int (*write_dac)(struct ad5592r_state *st, unsigned int chan, u16 value);
+ int (*read_adc)(struct ad5592r_state *st, unsigned int chan, u16 *value);
int (*reg_write)(struct ad5592r_state *st, u8 reg, u16 value);
int (*reg_read)(struct ad5592r_state *st, u8 reg, u16 *value);
int (*gpio_read)(struct ad5592r_state *st, u8 *value);
diff --git a/drivers/iio/dac/ad5592r.c b/drivers/iio/dac/ad5592r.c
index 92d1b629b..a40f590e6 100644
--- a/drivers/iio/dac/ad5592r.c
+++ b/drivers/iio/dac/ad5592r.c
@@ -30,7 +30,7 @@ static int ad5592r_spi_wnop_r16(struct ad5592r_state *st, __be16 *buf)
return spi_sync_transfer(spi, &t, 1);
}
-static int ad5592r_write_dac(struct ad5592r_state *st, unsigned chan, u16 value)
+static int ad5592r_write_dac(struct ad5592r_state *st, unsigned int chan, u16 value)
{
struct spi_device *spi = container_of(st->dev, struct spi_device, dev);
@@ -39,7 +39,7 @@ static int ad5592r_write_dac(struct ad5592r_state *st, unsigned chan, u16 value)
return spi_write(spi, &st->spi_msg, sizeof(st->spi_msg));
}
-static int ad5592r_read_adc(struct ad5592r_state *st, unsigned chan, u16 *value)
+static int ad5592r_read_adc(struct ad5592r_state *st, unsigned int chan, u16 *value)
{
struct spi_device *spi = container_of(st->dev, struct spi_device, dev);
int ret;
diff --git a/drivers/iio/dac/ad5593r.c b/drivers/iio/dac/ad5593r.c
index 9a8525c61..3bdb54820 100644
--- a/drivers/iio/dac/ad5593r.c
+++ b/drivers/iio/dac/ad5593r.c
@@ -40,7 +40,7 @@ static int ad5593r_read_word(struct i2c_client *i2c, u8 reg, u16 *value)
return 0;
}
-static int ad5593r_write_dac(struct ad5592r_state *st, unsigned chan, u16 value)
+static int ad5593r_write_dac(struct ad5592r_state *st, unsigned int chan, u16 value)
{
struct i2c_client *i2c = to_i2c_client(st->dev);
@@ -48,7 +48,7 @@ static int ad5593r_write_dac(struct ad5592r_state *st, unsigned chan, u16 value)
AD5593R_MODE_DAC_WRITE | chan, value);
}
-static int ad5593r_read_adc(struct ad5592r_state *st, unsigned chan, u16 *value)
+static int ad5593r_read_adc(struct ad5592r_state *st, unsigned int chan, u16 *value)
{
struct i2c_client *i2c = to_i2c_client(st->dev);
s32 val;
@@ -102,6 +102,7 @@ static const struct ad5592r_rw_ops ad5593r_rw_ops = {
static int ad5593r_i2c_probe(struct i2c_client *i2c)
{
const struct i2c_device_id *id = i2c_client_get_device_id(i2c);
+
if (!i2c_check_functionality(i2c->adapter,
I2C_FUNC_SMBUS_BYTE | I2C_FUNC_I2C))
return -EOPNOTSUPP;
--
2.49.0
next reply other threads:[~2025-05-03 9:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-03 9:55 akshay bansod [this message]
2025-05-03 15:22 ` [PATCH] iio: dac: ad559*: fixed coding style issue (shorthand unsigned) Marcelo Schmitt
2025-05-03 18:21 ` Akshay Bansod
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=20250503095532.132041-1-akshaybansod997@gmail.com \
--to=akshaybansod997@gmail.com \
--cc=Michael.Hennerich@analog.com \
--cc=andy@kernel.org \
--cc=brgl@bgdev.pl \
--cc=dlechner@baylibre.com \
--cc=jic23@kernel.org \
--cc=lars@metafoo.de \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-iio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=nuno.sa@analog.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;
as well as URLs for NNTP newsgroup(s).