Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1600201 > unrolled thread

[PATCH 0/5] fujitsu-laptop: platform device code cleanup

Started byMichał Kępień <kernel@kempniu.pl>
First post2017-03-14 11:30 +0100
Last post2017-03-22 17:10 +0100
Articles 6 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH 0/5] fujitsu-laptop: platform device code cleanup Michał Kępień <kernel@kempniu.pl> - 2017-03-14 11:30 +0100
    [PATCH 4/5] platform/x86: fujitsu-laptop: only register platform device if FUJ02E3 is present Michał Kępień <kernel@kempniu.pl> - 2017-03-14 11:30 +0100
    Re: [PATCH 0/5] fujitsu-laptop: platform device code cleanup Jonathan Woithe <jwoithe@just42.net> - 2017-03-15 01:30 +0100
      Re: [PATCH 0/5] fujitsu-laptop: platform device code cleanup Darren Hart <dvhart@infradead.org> - 2017-03-16 00:50 +0100
    Re: [PATCH 0/5] fujitsu-laptop: platform device code cleanup Jonathan Woithe <jwoithe@just42.net> - 2017-03-18 12:50 +0100
      Re: [PATCH 0/5] fujitsu-laptop: platform device code cleanup Darren Hart <dvhart@infradead.org> - 2017-03-22 17:10 +0100

#1600201 — [PATCH 0/5] fujitsu-laptop: platform device code cleanup

FromMichał Kępień <kernel@kempniu.pl>
Date2017-03-14 11:30 +0100
Subject[PATCH 0/5] fujitsu-laptop: platform device code cleanup
Message-ID<tkRSh-74u-11@gated-at.bofh.it>
This series removes backlight-related sysfs attributes from the platform
device registered by fujitsu-laptop and does some other cleanups to
platform device code which hopefully make it easier to understand.

 drivers/platform/x86/fujitsu-laptop.c | 197 ++++++++++------------------------
 1 file changed, 57 insertions(+), 140 deletions(-)

-- 
2.12.0

[toc] | [next] | [standalone]


#1600202 — [PATCH 4/5] platform/x86: fujitsu-laptop: only register platform device if FUJ02E3 is present

FromMichał Kępień <kernel@kempniu.pl>
Date2017-03-14 11:30 +0100
Subject[PATCH 4/5] platform/x86: fujitsu-laptop: only register platform device if FUJ02E3 is present
Message-ID<tkRSj-74u-31@gated-at.bofh.it>
In reply to#1600201
The platform device registered by fujitsu-laptop is registered
unconditionally while sysfs attributes attached to it depend on the
FUJ02E3 ACPI device being present.  Fix this by moving platform device
creation and removal to acpi_fujitsu_laptop_add() and
acpi_fujitsu_laptop_remove(), respectively.

Signed-off-by: Michał Kępień <kernel@kempniu.pl>
---
 drivers/platform/x86/fujitsu-laptop.c | 16 +++++++---------
 1 file changed, 7 insertions(+), 9 deletions(-)

diff --git a/drivers/platform/x86/fujitsu-laptop.c b/drivers/platform/x86/fujitsu-laptop.c
index 421402a19bb9..a2641cb79df9 100644
--- a/drivers/platform/x86/fujitsu-laptop.c
+++ b/drivers/platform/x86/fujitsu-laptop.c
@@ -903,6 +903,10 @@ static int acpi_fujitsu_laptop_add(struct acpi_device *device)
 			fujitsu_bl->bl_device->props.power = FB_BLANK_UNBLANK;
 	}
 
+	error = fujitsu_laptop_platform_add();
+	if (error)
+		goto err_unregister_input_dev;
+
 #if IS_ENABLED(CONFIG_LEDS_CLASS)
 	if (call_fext_func(FUNC_LEDS, 0x0, 0x0, 0x0) & LOGOLAMP_POWERON) {
 		result = led_classdev_register(&fujitsu_bl->pf_device->dev,
@@ -994,6 +998,8 @@ static int acpi_fujitsu_laptop_remove(struct acpi_device *device)
 		led_classdev_unregister(&eco_led);
 #endif
 
+	fujitsu_laptop_platform_remove();
+
 	input_unregister_device(input);
 
 	kfifo_free(&fujitsu_laptop->fifo);
@@ -1180,13 +1186,9 @@ static int __init fujitsu_init(void)
 
 	/* Register platform stuff */
 
-	ret = fujitsu_laptop_platform_add();
-	if (ret)
-		goto err_unregister_acpi;
-
 	ret = platform_driver_register(&fujitsu_pf_driver);
 	if (ret)
-		goto err_remove_platform_device;
+		goto err_unregister_acpi;
 
 	/* Register laptop driver */
 
@@ -1208,8 +1210,6 @@ static int __init fujitsu_init(void)
 	kfree(fujitsu_laptop);
 err_unregister_platform_driver:
 	platform_driver_unregister(&fujitsu_pf_driver);
-err_remove_platform_device:
-	fujitsu_laptop_platform_remove();
 err_unregister_acpi:
 	acpi_bus_unregister_driver(&acpi_fujitsu_bl_driver);
 err_free_fujitsu_bl:
@@ -1226,8 +1226,6 @@ static void __exit fujitsu_cleanup(void)
 
 	platform_driver_unregister(&fujitsu_pf_driver);
 
-	fujitsu_laptop_platform_remove();
-
 	acpi_bus_unregister_driver(&acpi_fujitsu_bl_driver);
 
 	kfree(fujitsu_bl);
-- 
2.12.0

[toc] | [prev] | [next] | [standalone]


#1600963

FromJonathan Woithe <jwoithe@just42.net>
Date2017-03-15 01:30 +0100
Message-ID<tl4Zb-83n-1@gated-at.bofh.it>
In reply to#1600201
Hi Michael

On Tue, Mar 14, 2017 at 11:26:26AM +0100, Micha?? K??pie?? wrote:
> This series removes backlight-related sysfs attributes from the platform
> device registered by fujitsu-laptop and does some other cleanups to
> platform device code which hopefully make it easier to understand.

Thanks for your continued clean up efforts.  I will review and test this in
the next few days.  I will be particularly busy between now and the weekend,
so in the worst case it could be Sunday before I get a chance to do this
thoroughly.  However, given the relative simplicity of the patches I will
try to get it done before then.

Regards
  jonathan

[toc] | [prev] | [next] | [standalone]


#1601812

FromDarren Hart <dvhart@infradead.org>
Date2017-03-16 00:50 +0100
Message-ID<tlqQ1-6uq-1@gated-at.bofh.it>
In reply to#1600963
On Wed, Mar 15, 2017 at 10:49:08AM +1030, Jonathan Woithe wrote:
> Hi Michael
> 
> On Tue, Mar 14, 2017 at 11:26:26AM +0100, Micha?? K??pie?? wrote:
> > This series removes backlight-related sysfs attributes from the platform
> > device registered by fujitsu-laptop and does some other cleanups to
> > platform device code which hopefully make it easier to understand.
> 
> Thanks for your continued clean up efforts.  I will review and test this in
> the next few days.  I will be particularly busy between now and the weekend,
> so in the worst case it could be Sunday before I get a chance to do this
> thoroughly.  However, given the relative simplicity of the patches I will
> try to get it done before then.

I'll await Jonathan's Reviewed-by, but I've reviewed these as well and they are
consistent with the discussion on the platform device sysfs attributes we had
previously and all look good to me.

-- 
Darren Hart
VMware Open Source Technology Center

[toc] | [prev] | [next] | [standalone]


#1603770

FromJonathan Woithe <jwoithe@just42.net>
Date2017-03-18 12:50 +0100
Message-ID<tml1U-5H9-7@gated-at.bofh.it>
In reply to#1600201
Apologies for the delay in reviewing this series: I've had a busy few days.

On Tue, Mar 14, 2017 at 11:26:26AM +0100, Micha?? K??pie?? wrote:
> This series removes backlight-related sysfs attributes from the platform
> device registered by fujitsu-laptop and does some other cleanups to
> platform device code which hopefully make it easier to understand.

This patch series codifies the outcome of discussions held over the last few
weeks and improves the consistency of the fujitsu-laptop driver with respect
to its treatment of sysfs attributes.  The additional minor cleanups
facilitated by these changes are also worthwhile.  The patch series has been
tested on the S7020 hardware and no regressions have been observed with the
hardware devices of that platform.  Please apply.

Tested-by: Jonathan Woithe <jwoithe@just42.net>
Reviewed-by: Jonathan Woithe <jwoithe@just42.net>

Regards
  jonathan

[toc] | [prev] | [next] | [standalone]


#1606705

FromDarren Hart <dvhart@infradead.org>
Date2017-03-22 17:10 +0100
Message-ID<tnQZI-586-21@gated-at.bofh.it>
In reply to#1603770
On Sat, Mar 18, 2017 at 10:10:35PM +1030, Jonathan Woithe wrote:
> Apologies for the delay in reviewing this series: I've had a busy few days.
> 
> On Tue, Mar 14, 2017 at 11:26:26AM +0100, Micha?? K??pie?? wrote:
> > This series removes backlight-related sysfs attributes from the platform
> > device registered by fujitsu-laptop and does some other cleanups to
> > platform device code which hopefully make it easier to understand.
> 
> This patch series codifies the outcome of discussions held over the last few
> weeks and improves the consistency of the fujitsu-laptop driver with respect
> to its treatment of sysfs attributes.  The additional minor cleanups
> facilitated by these changes are also worthwhile.  The patch series has been
> tested on the S7020 hardware and no regressions have been observed with the
> hardware devices of that platform.  Please apply.
> 
> Tested-by: Jonathan Woithe <jwoithe@just42.net>
> Reviewed-by: Jonathan Woithe <jwoithe@just42.net>

Applied, thanks Jonathan.

-- 
Darren Hart
VMware Open Source Technology Center

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web