Devicetree
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Joshua Felmeden <jfelmeden@thegoodpenguin.co.uk>
Cc: Lars-Peter Clausen <lars@metafoo.de>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	linux-iio@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH v6 2/2] iio: humidity: Add support for ENS210
Date: Sat, 17 Aug 2024 11:08:13 +0100	[thread overview]
Message-ID: <20240817110806.72f6b71a@jic23-huawei> (raw)
In-Reply-To: <20240805-ens21x-v6-2-5bb576ef26a6@thegoodpenguin.co.uk>

On Mon, 05 Aug 2024 09:12:53 +0100
Joshua Felmeden <jfelmeden@thegoodpenguin.co.uk> wrote:

> Add support for ENS210/ENS210A/ENS211/ENS212/ENS213A/ENS215.
> 
> The ENS21x is a family of temperature and relative humidity sensors with
> accuracies tailored to the needs of specific applications.
> 
> Signed-off-by: Joshua Felmeden <jfelmeden@thegoodpenguin.co.uk>

Hi Joshua,

Sorry for delay on this one, it was next on the list when I ran
out of time before going on a short vacation.

Anyhow, just some minor whitespace stuff so I'll tweak that
whilst applying.

Applied to the togreg branch of iio.git and pushed out as testing
for 0-day etc to poke at it and see if we missed anything.

Also a minor thing with scoped_guard().
Compilers can't figure out that there is not path out of that so
we get an unmarked fallthrough warning.

In file included from ./include/linux/irqflags.h:17,
                 from ./arch/x86/include/asm/special_insns.h:10,
                 from ./arch/x86/include/asm/processor.h:25,
                 from ./include/linux/sched.h:13,
                 from ./include/linux/delay.h:23,
                 from drivers/iio/humidity/ens210.c:18:
drivers/iio/humidity/ens210.c: In function ‘ens210_read_raw’:
./include/linux/cleanup.h:172:9: warning: this statement may fall through [-Wimplicit-fallthrough=]
  172 |         for (CLASS(_name, scope)(args),                                 \
      |         ^~~
drivers/iio/humidity/ens210.c:153:17: note: in expansion of macro ‘scoped_guard’
  153 |                 scoped_guard(mutex, &data->lock) {
      |                 ^~~~~~~~~~~~
drivers/iio/humidity/ens210.c:160:9: note: here
  160 |         case IIO_CHAN_INFO_SCALE:
      |         ^~~~
  CHECK   drivers/iio/humidity/ens210.c
  MODPOST Module.symvers

Annoyingly even an unreachable() doesn't work for this particular situation.

 CC [M]  drivers/iio/humidity/ens210.o
drivers/iio/humidity/ens210.o: warning: objtool: ens210_read_raw+0x52: can't find jump dest instruction at .text+0x36c

So for now I've added

diff --git a/drivers/iio/humidity/ens210.c b/drivers/iio/humidity/ens210.c
index bc5dedb46b83..e9167574203a 100644
--- a/drivers/iio/humidity/ens210.c
+++ b/drivers/iio/humidity/ens210.c
@@ -157,6 +157,7 @@ static int ens210_read_raw(struct iio_dev *indio_dev,
                                return ret;
                        return IIO_VAL_INT;
                }
+               return -EINVAL; /* compiler warning workaround */
        case IIO_CHAN_INFO_SCALE:
                if (channel->type == IIO_TEMP) {
                        *val = 15;

Thanks,

Jonathan

> diff --git a/drivers/iio/humidity/ens210.c b/drivers/iio/humidity/ens210.c
> new file mode 100644
> index 000000000000..719fdac817cf
> --- /dev/null
> +++ b/drivers/iio/humidity/ens210.c

> +
> +static int ens210_probe(struct i2c_client *client)
> +{
> +	struct ens210_data *data;
> +	struct iio_dev *indio_dev;
> +	uint16_t part_id;
> +	int ret;
> +
> +	if (!i2c_check_functionality(client->adapter,
> +				     I2C_FUNC_SMBUS_WRITE_BYTE_DATA |
> +					     I2C_FUNC_SMBUS_WRITE_BYTE |
> +					     I2C_FUNC_SMBUS_READ_I2C_BLOCK)) {
Non standard alignment. I'll fix up.

> +		return dev_err_probe(&client->dev, -EOPNOTSUPP,
> +			"adapter does not support some i2c transactions\n");
> +	}


      reply	other threads:[~2024-08-17 10:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-05  8:12 [PATCH v6 0/2] iio: humidity: Add support for ENS210 sensor family Joshua Felmeden
2024-08-05  8:12 ` [PATCH v6 1/2] dt-bindings: iio: humidity: add " Joshua Felmeden
2024-08-05  8:12 ` [PATCH v6 2/2] iio: humidity: Add support for ENS210 Joshua Felmeden
2024-08-17 10:08   ` Jonathan Cameron [this message]

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=20240817110806.72f6b71a@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jfelmeden@thegoodpenguin.co.uk \
    --cc=krzk+dt@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=robh@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