From: Yauhen Kharuzhy <jekhor@gmail.com>
To: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
Cc: platform-driver-x86@vger.kernel.org,
Hans de Goede <hansg@kernel.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v1 1/2] platform: x86-android-tablets: lenovo: Add Yoga Book haptics entries
Date: Tue, 24 Feb 2026 01:41:12 +0200 [thread overview]
Message-ID: <aZzlQWTkm0RaPaXV@jekhomev> (raw)
In-Reply-To: <181e4409-7bbf-e207-0c54-1f817c1c35ed@linux.intel.com>
On Mon, Feb 23, 2026 at 04:26:25PM +0200, Ilpo Järvinen wrote:
> On Wed, 18 Feb 2026, Yauhen Kharuzhy wrote:
>
> > Add drv2604l i2c_board_info for drv2604l haptics drivers present in
> > Lenovo Yoga Book YB1-X90 and YB1-X91. Set properties required for device
> > initialization and self-calibration.
> >
> > Signed-off-by: Yauhen Kharuzhy <jekhor@gmail.com>
> > ---
> > .../platform/x86/x86-android-tablets/lenovo.c | 96 +++++++++++++++++++
> > 1 file changed, 96 insertions(+)
> >
> >
> > +#define YB1_X91_DRV2604L_0_DEVICE "i2c-DRV2604:00"
> > +#define YB1_X91_DRV2604L_1_DEVICE "i2c-DRV2604:01"
> > +
> > +static int __init lenovo_yb1_x91_init(struct device *dev)
> > +{
> > + struct device *drv2604l_0_dev = NULL, *drv2604l_1_dev = NULL;
> > + int ret = 0;
> > +
> > + drv2604l_0_dev = bus_find_device_by_name(&i2c_bus_type, NULL,
> > + YB1_X91_DRV2604L_0_DEVICE);
> > + if (!drv2604l_0_dev) {
> > + pr_err("error: cannot find %s device\n",
> > + YB1_X91_DRV2604L_0_DEVICE);
> > + return -ENODEV;
> > + }
> > +
> > + ret = device_create_managed_software_node(drv2604l_0_dev,
> > + lenovo_yb1_x9x_drv2604l_0_props, NULL);
> > + if (ret) {
> > + pr_err("error: cannot create software node for %s: %d\n",
> > + YB1_X91_DRV2604L_0_DEVICE, ret);
> > + goto put_drv2604l_0;
> > + }
> > +
> > + drv2604l_1_dev = bus_find_device_by_name(&i2c_bus_type, NULL,
> > + YB1_X91_DRV2604L_1_DEVICE);
> > + if (!drv2604l_1_dev) {
> > + pr_err("error: cannot find %s device\n",
> > + YB1_X91_DRV2604L_1_DEVICE);
> > + ret = -ENODEV;
> > + goto put_drv2604l_0;
> > + }
> > +
> > + ret = device_create_managed_software_node(drv2604l_1_dev,
> > + lenovo_yb1_x9x_drv2604l_1_props, NULL);
> > + if (ret) {
> > + pr_err("error: cannot create software node for %s\n",
> > + YB1_X91_DRV2604L_1_DEVICE);
> > + ret = -EINVAL;
> > + goto put_drv2604l_1;
> > + }
> > +
> > +put_drv2604l_0:
> > + put_device(drv2604l_0_dev);
> > +put_drv2604l_1:
> > + put_device(drv2604l_1_dev);
>
> This looks like a case that would benefit from using cleanup.h
> (__free(put_device)).
>
> Remember to declare variables that use __free() mid-function as per the
> usage pattern in documented cleanup.h.
>
> Please also make sure you have all necessary includes for using it (not
> through some obscure indirect include path).
A good point, thanks!
--
Yauhen Kharuzhy
next prev parent reply other threads:[~2026-02-23 23:41 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-02-17 23:36 [PATCH v1 0/2] x86-android-tablets: Add sound and haptics support for Lenovo YB1-X9* Yauhen Kharuzhy
2026-02-17 23:36 ` [PATCH v1 1/2] platform: x86-android-tablets: lenovo: Add Yoga Book haptics entries Yauhen Kharuzhy
2026-02-23 14:26 ` Ilpo Järvinen
2026-02-23 23:41 ` Yauhen Kharuzhy [this message]
2026-02-17 23:36 ` [PATCH v1 2/2] platform: x86-android-tablets: lenovo: Add Yoga Book YB1 sound card info Yauhen Kharuzhy
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=aZzlQWTkm0RaPaXV@jekhomev \
--to=jekhor@gmail.com \
--cc=hansg@kernel.org \
--cc=ilpo.jarvinen@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=platform-driver-x86@vger.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