[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180420163924.5227-2-brgl@bgdev.pl>
Date: Fri, 20 Apr 2018 18:39:23 +0200
From: Bartosz Golaszewski <brgl@...ev.pl>
To: Arnd Bergmann <arnd@...db.de>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Jan Kiszka <jan.kiszka@...mens.com>,
Andy Shevchenko <andy.shevchenko@...il.com>
Cc: linux-kernel@...r.kernel.org,
Bartosz Golaszewski <bgolaszewski@...libre.com>
Subject: [PATCH 1/2] platform: provide early_platform_add_device()
From: Bartosz Golaszewski <bgolaszewski@...libre.com>
Currently we only have early_platform_add_devices() which takes struct
platform_device ** as argument, requiring the users to have an
intermediate array of platform_device pointers even if we're only
adding a single device. Provide a helper for adding a single device at
a time.
Signed-off-by: Bartosz Golaszewski <bgolaszewski@...libre.com>
---
include/linux/platform_device.h | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
index 49f634d96118..80942ed0f728 100644
--- a/include/linux/platform_device.h
+++ b/include/linux/platform_device.h
@@ -301,6 +301,11 @@ extern int early_platform_driver_register(struct early_platform_driver *epdrv,
char *buf);
extern void early_platform_add_devices(struct platform_device **devs, int num);
+static inline void early_platform_add_device(struct platform_device *pdev)
+{
+ early_platform_add_devices(&pdev, 1);
+}
+
static inline int is_early_platform_device(struct platform_device *pdev)
{
return !pdev->dev.driver;
--
2.17.0
Powered by blists - more mailing lists