public inbox for linux-leds@vger.kernel.org
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@ucw.cz>
To: Alan Mizrahi <alan@mizrahi.com.ve>
Cc: linux-leds@vger.kernel.org
Subject: Re: PC Engines APU/APU2 led driver
Date: Mon, 11 Sep 2017 08:15:14 +0200	[thread overview]
Message-ID: <20170911061514.GA25933@amd> (raw)
In-Reply-To: <1c59aa68-cc27-c577-312a-14f58b62dd89@mizrahi.com.ve>

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

Hi!

> static int __init apu_led_init(void)
> {
> 	struct platform_device *pdev;
> 	int err;
> 
> 	if (!dmi_match(DMI_SYS_VENDOR, "PC Engines")) {
> 		pr_err("No PC Engines board detected\n");
> 		return -ENODEV;
> 	}
> 	if (!(dmi_match(DMI_PRODUCT_NAME, "APU") || dmi_match(DMI_PRODUCT_NAME, "APU2"))) {
> 		printk(KERN_ERR "Unknown PC Engines board: %s\n", dmi_get_system_info(DMI_PRODUCT_NAME));
> 		return -ENODEV;
> 	}
> 
> 	pdev = platform_device_register_simple(KBUILD_MODNAME, -1, NULL, 0);
> 	if (IS_ERR(pdev)) {
> 		pr_err("Device allocation failed\n");
> 		return PTR_ERR(pdev);
> 	}
> 
> 	err = platform_driver_probe(&apu_led_driver, apu_led_probe);
> 	if (err) {
> 		pr_err("Probe platform driver failed\n");
> 		platform_device_unregister(pdev);
> 	}
> 
> 	return err;
> }
> 
> static void __exit apu_led_exit(void)
> {
> 	platform_device_unregister(apu_led->pdev);
> 	platform_driver_unregister(&apu_led_driver);
> }

Normally, I'd expect _exit() to be 'reverse' of _init(). That is I'd
expect reverese order there.
								Pavel

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

  reply	other threads:[~2017-09-11  6:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-11  5:35 PC Engines APU/APU2 led driver Alan Mizrahi
2017-09-11  6:15 ` Pavel Machek [this message]
2017-09-11  9:45   ` Alan Mizrahi
2017-09-16 13:52     ` Pavel Machek
2017-09-16 13:57       ` Alan Mizrahi
2017-09-16 15:27         ` Jacek Anaszewski
2017-09-11 20:46 ` Jacek Anaszewski

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=20170911061514.GA25933@amd \
    --to=pavel@ucw.cz \
    --cc=alan@mizrahi.com.ve \
    --cc=linux-leds@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