lkml.org 
[lkml]   [2022]   [Sep]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 5/5] bus: hisi_lpc: Use platform_device_register_full()
On Thu, Sep 1, 2022 at 2:37 PM John Garry <john.garry@huawei.com> wrote:
>
> The code to create the child platform device is essentially the same as
> what platform_device_register_full() does, so change over to use
> that same function to reduce duplication.

Thanks!

> drivers/bus/hisi_lpc.c | 70 ++++++++++++++++++++++--------------------
> 1 file changed, 36 insertions(+), 34 deletions(-)

Looking at the statistics I thought it was a scary "improvement", but...

...

> /* ipmi */
> {
> .hid = "IPI0001",
> - .name = "hisi-lpc-ipmi",
> + .pdevinfo = (struct platform_device_info []) {
> + {
> + .parent = hostdev,
> + .fwnode = acpi_fwnode_handle(child),
> +
> + .name = "hisi-lpc-ipmi",
> + .id = PLATFORM_DEVID_AUTO,
> +
> + .res = res,
> + .num_res = num_res,
> + },

...here and in the other cases you have a lot of blank lines, can we
just get rid of them?

> + },
> },
> /* 8250-compatible uart */
> {
> .hid = "HISI1031",
> - .name = "serial8250",
> - .pdata = (struct plat_serial8250_port []) {
> + .pdevinfo = (struct platform_device_info []) {
> {
> - .iobase = res->start,
> - .uartclk = 1843200,
> - .iotype = UPIO_PORT,
> - .flags = UPF_BOOT_AUTOCONF,
> + .parent = hostdev,
> + .fwnode = acpi_fwnode_handle(child),
> +
> + .name = "serial8250",
> + .id = PLATFORM_DEVID_AUTO,
> +
> + .res = res,
> + .num_res = num_res,
> +
> + .data = (struct plat_serial8250_port []) {
> + {
> + .iobase = res->start,
> + .uartclk = 1843200,
> + .iotype = UPIO_PORT,
> + .flags = UPF_BOOT_AUTOCONF,
> + },
> + {}
> + },

> + .size_data = 2 *
> + sizeof(struct plat_serial8250_port),

I believe this can be one line.

> },
> },

--
With Best Regards,
Andy Shevchenko

\
 
 \ /
  Last update: 2022-09-01 19:49    [W:0.320 / U:1.036 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site