Re: [PATCH v2] platform/x86: add meraki-mx100 platform driver

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Aug 6, 2021 at 5:47 AM Chris Blake <chrisrblake93@xxxxxxxxx> wrote:
>
> This adds platform support for the Cisco Meraki MX100 (Tinkerbell)
> network appliance. This sets up the network LEDs and Reset
> button. Note that this patch requires

> mfd: lpc_ich: Enable GPIO driver for DH89xxCC

Use standard format for the commits, and you may find its SHA in the
repository of respective maintainer I suppose.

> which has been accepted
> and is currently targeted for 5.15.
>
> Signed-off-by: Chris Blake <chrisrblake93@xxxxxxxxx>

> Co-developed-by: Christian Lamparter <chunkeey@xxxxxxxxx>

Missed SoB of co-developer.

...

> +#include <linux/gpio.h>

This is wrong. Mustn't be included in the new code.

> +#include <linux/gpio_keys.h>

> +#include <linux/gpio/machine.h>

Does this provide a GPIO controller driver? I don't think so.

> +#include <linux/input.h>
> +#include <linux/kernel.h>
> +#include <linux/leds.h>
> +#include <linux/module.h>
> +#include <linux/platform_device.h>

...

> +static struct platform_device * __init tink_create_dev(
> +       const char *name,
> +       const void *pdata,
> +       size_t sz)

Use less LOCs for this...

...

> +       pdev = platform_device_register_data(NULL,
> +               name,
> +               PLATFORM_DEVID_NONE,
> +               pdata,
> +               sz);

...and for this (put name and sz to the respective previous lines).

> +

Unneeded blank line.

> +       if (IS_ERR(pdev))
> +               pr_err("failed registering %s: %ld\n", name, PTR_ERR(pdev));
> +

...

> +       /* We need to make sure that GPIO60 isn't set to native mode as is default since it's our
> +        * Reset Button. To do this, write to GPIO_USE_SEL2 to have GPIO60 set to GPIO mode.
> +        * This is documented on page 1609 of the PCH datasheet, order number 327879-005US
> +        */

/*
 * Multi-line comment style is not
 * for this subsystem.
 */

...

> +       tink_leds_pdev = tink_create_dev(
> +               "leds-gpio",
> +               &tink_leds_pdata,
> +               sizeof(tink_leds_pdata));
> +
> +       tink_keys_pdev = tink_create_dev(
> +               "gpio-keys-polled",
> +               &tink_buttons_pdata,
> +               sizeof(tink_buttons_pdata));

Again, use less LOCs.

...

> +

Unneeded blank line, attach the below to the respective functions

> +module_init(tink_board_init);
> +module_exit(tink_board_exit);

...

> +MODULE_DEVICE_TABLE(dmi, tink_systems);
Put this closer to the structure.

-- 
With Best Regards,
Andy Shevchenko



[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux