* Andy Shevchenko <andriy.shevchenko@xxxxxxxxx> [221207 20:28]: > We can avoid this check by caching the platform device. > > struct platform_device *ctrl_pdev = NULL; > > if (...) { > ctrl_pdev = to_platform_device(ctrl_dev); > } > > platform_device_del(ctrl_pdev); OK yeah that's nicer :) > > Shouldn't you call platform_device_unregister()? Outside the error path it should be platform_device_unregister(), I'll check. Thanks also for your other comments. Regards, Tony