public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
From: "Ilpo Järvinen" <ilpo.jarvinen@linux.intel.com>
To: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Robert Gerlach <khnz@gmx.de>, Hans de Goede <hansg@kernel.org>,
	 LKML <linux-kernel@vger.kernel.org>,
	 Linux ACPI <linux-acpi@vger.kernel.org>,
	 platform-driver-x86@vger.kernel.org,
	Jonathan Woithe <jwoithe@just42.net>
Subject: Re: [PATCH v2 3/5] platform/x86: fujitsu: Register ACPI notify handlers directly
Date: Tue, 17 Mar 2026 17:56:31 +0200 (EET)	[thread overview]
Message-ID: <2c1378d5-7dce-2d22-6013-53e4b027d41c@linux.intel.com> (raw)
In-Reply-To: <CAJZ5v0g1M_rooYSYvFN4Chq-NovvS=gc5dhdw_BRvd-1S_tVVg@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 3834 bytes --]

On Tue, 17 Mar 2026, Rafael J. Wysocki wrote:

> On Tue, Mar 17, 2026 at 4:19 PM Ilpo Järvinen
> <ilpo.jarvinen@linux.intel.com> wrote:
> >
> > On Mon, 9 Mar 2026, Rafael J. Wysocki wrote:
> >
> > > From: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
> > >
> > > To facilitate subsequent conversion of the driver to using struct
> > > platform_driver instead of struct acpi_driver, make it install its ACPI
> > > notify handlers directly instead of using struct acpi_driver .notify()
> > > callbacks.
> > >
> > > No intentional functional impact.
> > >
> > > Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
> > > ---
> > >
> > > v1 -> v2: Call fujitsu_laptop_platform_remove() in acpi_fujitsu_laptop_add()
> > >    error code path if notify handler registration fails (Ilpo)
> >
> > Hmm, did you forget to commit something as I don't see this addressed
> > below?
> 
> No, I didn't.  It's there, you had a comment on it below even.

Yes, sorry, I forgot I'd already written this (and to remove it), only 
after having written this I noticed it was done differently than what I 
had expected.

-- 
 i.


> > > ---
> > >  drivers/platform/x86/fujitsu-laptop.c | 32 ++++++++++++++++++++++-----
> > >  1 file changed, 27 insertions(+), 5 deletions(-)
> > >
> > > diff --git a/drivers/platform/x86/fujitsu-laptop.c b/drivers/platform/x86/fujitsu-laptop.c
> > > index 1adce90ae3e6..7816a867a60c 100644
> > > --- a/drivers/platform/x86/fujitsu-laptop.c
> > > +++ b/drivers/platform/x86/fujitsu-laptop.c
> > > @@ -502,8 +502,9 @@ static int fujitsu_backlight_register(struct acpi_device *device)
> > >
> > >  /* Brightness notify */
> > >
> > > -static void acpi_fujitsu_bl_notify(struct acpi_device *device, u32 event)
> > > +static void acpi_fujitsu_bl_notify(acpi_handle handle, u32 event, void *data)
> > >  {
> > > +     struct acpi_device *device = data;
> > >       struct fujitsu_bl *priv = acpi_driver_data(device);
> > >       int oldb, newb;
> > >
> > > @@ -558,7 +559,18 @@ static int acpi_fujitsu_bl_add(struct acpi_device *device)
> > >       if (ret)
> > >               return ret;
> > >
> > > -     return fujitsu_backlight_register(device);
> > > +     ret = fujitsu_backlight_register(device);
> > > +     if (ret)
> > > +             return ret;
> > > +
> > > +     return acpi_dev_install_notify_handler(device, ACPI_DEVICE_NOTIFY,
> > > +                                            acpi_fujitsu_bl_notify, device);
> > > +}
> > > +
> > > +static void acpi_fujitsu_bl_remove(struct acpi_device *device)
> > > +{
> > > +     acpi_dev_remove_notify_handler(device, ACPI_DEVICE_NOTIFY,
> > > +                                    acpi_fujitsu_bl_notify);
> > >  }
> > >
> > >  /* ACPI device for hotkey handling */
> > > @@ -941,8 +953,9 @@ static void acpi_fujitsu_laptop_release(struct acpi_device *device)
> > >       }
> > >  }
> > >
> > > -static void acpi_fujitsu_laptop_notify(struct acpi_device *device, u32 event)
> > > +static void acpi_fujitsu_laptop_notify(acpi_handle handle, u32 event, void *data)
> > >  {
> > > +     struct acpi_device *device = data;
> > >       struct fujitsu_laptop *priv = acpi_driver_data(device);
> > >       unsigned long flags;
> > >       int scancode, i = 0;
> > > @@ -1056,6 +1069,13 @@ static int acpi_fujitsu_laptop_add(struct acpi_device *device)
> > >       if (ret)
> > >               goto err_free_fifo;
> > >
> > > +     ret = acpi_dev_install_notify_handler(device, ACPI_DEVICE_NOTIFY,
> > > +                                           acpi_fujitsu_laptop_notify, device);
> > > +     if (ret) {
> > > +             fujitsu_laptop_platform_remove(device);
> >
> > Please add this into the rollback path instead and add another label
> > there.
> 
> OK
> 

  reply	other threads:[~2026-03-17 15:56 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-03-09 17:03 [PATCH v2 0/5] platform/x86: fujitsu: Bind drivers to platform devices instead of ACPI ones Rafael J. Wysocki
2026-03-09 17:04 ` [PATCH v2 1/5] platform/x86: fujitsu-tablet: Convert ACPI driver to a platform one Rafael J. Wysocki
2026-03-09 17:05 ` [PATCH v2 2/5] platform/x86: fujitsu: Reorder code to avoid forward declarations Rafael J. Wysocki
2026-03-09 17:07 ` [PATCH v2 3/5] platform/x86: fujitsu: Register ACPI notify handlers directly Rafael J. Wysocki
2026-03-17 15:19   ` Ilpo Järvinen
2026-03-17 15:52     ` Rafael J. Wysocki
2026-03-17 15:56       ` Ilpo Järvinen [this message]
2026-03-09 17:09 ` [PATCH v2 5/5] platform/x86: fujitsu: Convert laptop driver to a platform one Rafael J. Wysocki
2026-03-09 17:10 ` [PATCH v2 4/5] platform/x86: fujitsu: Convert backlight " Rafael J. Wysocki
2026-03-10  0:36 ` [PATCH v2 0/5] platform/x86: fujitsu: Bind drivers to platform devices instead of ACPI ones Jonathan Woithe
2026-03-10  9:48   ` Rafael J. Wysocki

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=2c1378d5-7dce-2d22-6013-53e4b027d41c@linux.intel.com \
    --to=ilpo.jarvinen@linux.intel.com \
    --cc=hansg@kernel.org \
    --cc=jwoithe@just42.net \
    --cc=khnz@gmx.de \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=rafael@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