lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20230903130436.3587abcd@jic23-huawei>
Date:   Sun, 3 Sep 2023 13:04:36 +0100
From:   Jonathan Cameron <jic23@...nel.org>
To:     Biju Das <biju.das.jz@...renesas.com>
Cc:     Lars-Peter Clausen <lars@...afoo.de>,
        Uwe Kleine-König 
        <u.kleine-koenig@...gutronix.de>,
        Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
        linux-iio@...r.kernel.org, linux-kernel@...r.kernel.org,
        Biju Das <biju.das.au@...il.com>
Subject: Re: [PATCH] iio: adc: ti-ads1015: Simplify probe()

On Sat,  2 Sep 2023 17:32:33 +0100
Biju Das <biju.das.jz@...renesas.com> wrote:

> Simpilfy probe() by replacing device_get_match_data() and id lookup for
> retrieving match data by using i2c_get_match_data().
> 
> Signed-off-by: Biju Das <biju.das.jz@...renesas.com>
Applied.

> ---
>  drivers/iio/adc/ti-ads1015.c | 5 +----
>  1 file changed, 1 insertion(+), 4 deletions(-)
> 
> diff --git a/drivers/iio/adc/ti-ads1015.c b/drivers/iio/adc/ti-ads1015.c
> index 075c75a87544..9984515bfdea 100644
> --- a/drivers/iio/adc/ti-ads1015.c
> +++ b/drivers/iio/adc/ti-ads1015.c
> @@ -976,16 +976,13 @@ static int ads1015_set_conv_mode(struct ads1015_data *data, int mode)
>  
>  static int ads1015_probe(struct i2c_client *client)
>  {
> -	const struct i2c_device_id *id = i2c_client_get_device_id(client);
>  	const struct ads1015_chip_data *chip;
>  	struct iio_dev *indio_dev;
>  	struct ads1015_data *data;
>  	int ret;
>  	int i;
>  
> -	chip = device_get_match_data(&client->dev);
> -	if (!chip)
> -		chip = (const struct ads1015_chip_data *)id->driver_data;
> +	chip = i2c_get_match_data(client);
>  	if (!chip)
>  		return dev_err_probe(&client->dev, -EINVAL, "Unknown chip\n");
>  

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ