lkml.org 
[lkml]   [2019]   [Dec]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] x86/platform/goldfish: add a check for platform_device_register_simple
On Mon, Dec 9, 2019 at 6:22 PM Chuhong Yuan <hslester96@gmail.com> wrote:
>
> goldfish_init() misses a check for platform_device_register_simple().
> Add a check to fix it.

Thanks for a patch. My comments below.

> static int __init goldfish_init(void)
> {
> + struct platform_device *pdev;
> +
> if (!goldfish_enable)
> return -ENODEV;
>
> - platform_device_register_simple("goldfish_pdev_bus", -1,
> - goldfish_pdev_bus_resources, 2);

> + pdev = platform_device_register_simple("goldfish_pdev_bus", -1,

Perhaps idea for a separate patch or maybe here:
-1 -> PLATFORM_DEVID_NONE

> + goldfish_pdev_bus_resources, 2);

> + if (IS_ERR(pdev))
> + return PTR_ERR(pdev);
> +
> return 0;

This can use PTR_ERR_OR_ZERO() macro instead.

> }


--
With Best Regards,
Andy Shevchenko

\
 
 \ /
  Last update: 2019-12-09 18:56    [W:0.026 / U:4.868 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site