[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75Vex6dhhaUFA+5SaC45HCNVpx3gzRYJ8CQA7kz+K_NQ-cg@mail.gmail.com>
Date: Thu, 14 Feb 2019 04:13:54 +0200
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: "Enrico Weigelt, metux IT consult" <info@...ux.net>
Cc: Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Platform Driver <platform-driver-x86@...r.kernel.org>,
Andy Shevchenko <andy@...radead.org>,
Darren Hart <dvhart@...radead.org>,
Bartosz Golaszewski <bgolaszewski@...libre.com>,
Linus Walleij <linus.walleij@...aro.org>,
"open list:GPIO SUBSYSTEM" <linux-gpio@...r.kernel.org>
Subject: Re: [PATCH 2/2] x86: pcengines apuv2 gpio/leds/keys platform driver
On Wed, Feb 13, 2019 at 10:57 PM Enrico Weigelt, metux IT consult
<info@...ux.net> wrote:
>
> Driver for PCengines APUv2 board's front LEDs and Button,
> which are attached to AMD PCH GPIOs. Due to lack of dedicated
> ACPI entry, detecting the board via DMI.
> +#include <linux/init.h>
> +#include <linux/module.h>
One of them is not needed.
> +static struct platform_device * __init apu_create_pdev(
> + const char* name,
> + const void *pdata,
> + size_t sz)
> +{
> + struct platform_device *pdev;
> +
> + pdev = platform_device_register_resndata(
> + NULL, /* parent */
> + name, /* name */
> + PLATFORM_DEVID_NONE, /* id */
> + NULL, /* res */
> + 0, /* res_num */
> + pdata, /* platform_data */
> + sz);
No need to comment the obvious.
> +
> + if (IS_ERR(pdev))
> + pr_err(KBUILD_MODNAME ": failed registering %s: %ld\n", name, PTR_ERR(pdev));
Better to set pr_fmt() macro at the top of source.
> +
> + return pdev;
> +}
> +
> +static int __init apu_board_init(void)
> +{
> + int rc;
> + const struct dmi_system_id *id;
> +
> + id = dmi_first_match(apu_gpio_dmi_table);
> +
Redundant blank line.
> + if (!id) {
> + pr_err(KBUILD_MODNAME ": failed to detect apu board via dmi\n");
pr_fmt()
> + return -ENODEV;
> + }
> + pr_info(KBUILD_MODNAME ": initialized: gpio, leds, keys\n");
Noise.
> + return 0;
> +}
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists