I wonder if we should pass &pdev->dev instead of NULL here to form
proper device hierarchy, now that we have this option.
+ "gpio-keys",
+ PLATFORM_DEVID_AUTO,
+ NULL,
+ 0,
+ gpio_keys_pdata,
+ sizeof(*gpio_keys_pdata));
+
+ if (IS_ERR(pd)) {
+ dev_err(&pdev->dev, "failed registering gpio-keys: %ld\n", PTR_ERR(pd));
goto err_free_mem;
Since you did not assign 'error' value here this goto will result in the
function returning 0 even if platform_device_register_resndata() failed.