From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Wolfram Sang <wsa+renesas@sang-engineering.com>
Cc: linux-input@vger.kernel.org, linux-i2c@vger.kernel.org
Subject: Re: [PATCH RESEND] input: mouse: convert to i2c_new_scanned_device
Date: Sat, 15 Feb 2020 15:49:03 -0800 [thread overview]
Message-ID: <20200215234903.GN183709@dtor-ws> (raw)
In-Reply-To: <20200210165902.5250-1-wsa+renesas@sang-engineering.com>
On Mon, Feb 10, 2020 at 05:59:02PM +0100, Wolfram Sang wrote:
> Move from the deprecated i2c_new_probed_device() to the new
> i2c_new_scanned_device(). Make use of the new ERRPTR if suitable.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Applied, thank you.
> ---
>
> Build tested only.
>
> drivers/input/mouse/psmouse-smbus.c | 7 ++++---
> 1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/input/mouse/psmouse-smbus.c b/drivers/input/mouse/psmouse-smbus.c
> index 027efdd2b2ad..27358e543283 100644
> --- a/drivers/input/mouse/psmouse-smbus.c
> +++ b/drivers/input/mouse/psmouse-smbus.c
> @@ -190,6 +190,7 @@ static int psmouse_smbus_create_companion(struct device *dev, void *data)
> struct psmouse_smbus_dev *smbdev = data;
> unsigned short addr_list[] = { smbdev->board.addr, I2C_CLIENT_END };
> struct i2c_adapter *adapter;
> + struct i2c_client *client;
>
> adapter = i2c_verify_adapter(dev);
> if (!adapter)
> @@ -198,12 +199,12 @@ static int psmouse_smbus_create_companion(struct device *dev, void *data)
> if (!i2c_check_functionality(adapter, I2C_FUNC_SMBUS_HOST_NOTIFY))
> return 0;
>
> - smbdev->client = i2c_new_probed_device(adapter, &smbdev->board,
> - addr_list, NULL);
> - if (!smbdev->client)
> + client = i2c_new_scanned_device(adapter, &smbdev->board, addr_list, NULL);
> + if (IS_ERR(client))
> return 0;
>
> /* We have our(?) device, stop iterating i2c bus. */
> + smbdev->client = client;
> return 1;
> }
>
> --
> 2.20.1
>
--
Dmitry
prev parent reply other threads:[~2020-02-15 23:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-10 16:59 [PATCH RESEND] input: mouse: convert to i2c_new_scanned_device Wolfram Sang
2020-02-15 23:49 ` Dmitry Torokhov [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=20200215234903.GN183709@dtor-ws \
--to=dmitry.torokhov@gmail.com \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-input@vger.kernel.org \
--cc=wsa+renesas@sang-engineering.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).