Linux IIO development
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: Sebastian Aguilera Novoa <saguileranbr@gmail.com>
Cc: saguileran@ime.usp.br, linux-iio@vger.kernel.org
Subject: Re: [PATCH] iio: pressure: hp03: Drop explicit hp03_is_writeable_reg and hp03_is_volatile_reg functions
Date: Tue, 29 Apr 2025 18:41:29 +0100	[thread overview]
Message-ID: <20250429184129.7aff4461@jic23-huawei> (raw)
In-Reply-To: <20250429165604.67984-1-saguileran@ime.usp.br>

On Tue, 29 Apr 2025 13:56:03 -0300
Sebastian Aguilera Novoa <saguileranbr@gmail.com> wrote:

> Drop functions hp03_is_writeable_reg and hp03_is_volatile_reg. Both
> functions always return false, regardless of the register number or
> device. They are used in a single place within the hp03_regmap_config
> and can be replaced directly.
> 
> The HP03 Series of calibrated sensor module datasheet (1) document
> does not contain any information about the register values to define
> states for the functions.
> 
> (1): https://www.sensorica.ru/pdf/HP03.pdf
> 
> Signed-off-by: Sebastian Aguilera Novoa <saguileran@ime.usp.br>

Take another look at what you are doing here.

+ the warnings it gives...

> ---
>  drivers/iio/pressure/hp03.c | 14 ++------------
>  1 file changed, 2 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/iio/pressure/hp03.c b/drivers/iio/pressure/hp03.c
> index 6f7a16787143..a69f6f5ce248 100644
> --- a/drivers/iio/pressure/hp03.c
> +++ b/drivers/iio/pressure/hp03.c
> @@ -57,16 +57,6 @@ static const struct iio_chan_spec hp03_channels[] = {
>  	},
>  };
>  
> -static bool hp03_is_writeable_reg(struct device *dev, unsigned int reg)
> -{
> -	return false;
> -}
> -
> -static bool hp03_is_volatile_reg(struct device *dev, unsigned int reg)
> -{
> -	return false;
> -}
> -
>  static const struct regmap_config hp03_regmap_config = {
>  	.reg_bits	= 8,
>  	.val_bits	= 8,
> @@ -74,8 +64,8 @@ static const struct regmap_config hp03_regmap_config = {
>  	.max_register	= HP03_EEPROM_CD_OFFSET + 1,
>  	.cache_type	= REGCACHE_RBTREE,
>  
> -	.writeable_reg	= hp03_is_writeable_reg,
> -	.volatile_reg	= hp03_is_volatile_reg,
> +	.writeable_reg	= false,
> +	.volatile_reg	= false,
>  };
>  
>  static int hp03_get_temp_pressure(struct hp03_priv *priv, const u8 reg)


      reply	other threads:[~2025-04-29 17:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-29 16:56 [PATCH] iio: pressure: hp03: Drop explicit hp03_is_writeable_reg and hp03_is_volatile_reg functions Sebastian Aguilera Novoa
2025-04-29 17:41 ` 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=20250429184129.7aff4461@jic23-huawei \
    --to=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=saguileran@ime.usp.br \
    --cc=saguileranbr@gmail.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