]> git.baikalelectronics.ru Git - kernel.git/commit
driver core: platform: Respect return code of platform_device_register_full()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Mon, 3 Dec 2018 18:21:41 +0000 (20:21 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 6 Dec 2018 13:00:06 +0000 (14:00 +0100)
commitb7b78ea770afd2e6ea85d70bfedddb94531d1f16
tree9152a4b819c68ad76cc86c83afe321cb761b976e
parent3e171e07d508efeca18ffa2f1fdaeb4835db62e2
driver core: platform: Respect return code of platform_device_register_full()

The platform_device_register_full() might return an error pointer. If we
instantiate platform device which is optional we may simplify the routine at
removal stage by simply calling platform_device_unregister(). For now it
requires to check parameter for being an error pointer in each caller.

To make users' life easier, check for an error pointer inside driver core.

Reported-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/base/platform.c