summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorRouven Czerwinski <r.czerwinski@pengutronix.de>2020-11-09 14:44:25 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2020-11-12 11:28:20 +0100
commitbae260ab38cc98b7482f271dc9a9b1c24cbdaf93 (patch)
treee20fa7587ef4e6188ac4abe763124f0e5ace6900 /include
parentb93dfbbac6769c2f129777d4cbfaa0f466297a77 (diff)
downloadbarebox-bae260ab38cc98b7482f271dc9a9b1c24cbdaf93.tar.gz
barebox-bae260ab38cc98b7482f271dc9a9b1c24cbdaf93.tar.xz
amba: add *_amba_driver helper macros
Reuse the flexible register_driver_macro() to add {device,coredevice,console}_amba_driver to get rid of the init boilerplate code used within the amba drivers. Signed-off-by: Rouven Czerwinski <r.czerwinski@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include')
-rw-r--r--include/linux/amba/bus.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/amba/bus.h b/include/linux/amba/bus.h
index 7b3e603322..390220a3de 100644
--- a/include/linux/amba/bus.h
+++ b/include/linux/amba/bus.h
@@ -60,6 +60,13 @@ extern struct bus_type amba_bustype;
#define to_amba_device(d) container_of(d, struct amba_device, dev)
+#define device_amba_driver(drv) \
+ register_driver_macro(device,amba,drv)
+#define coredevice_amba_driver(drv) \
+ register_driver_macro(coredevice,amba,drv)
+#define console_amba_driver(drv) \
+ register_driver_macro(console,amba,drv)
+
int amba_driver_register(struct amba_driver *);
void amba_driver_unregister(struct amba_driver *);
struct amba_device *amba_device_alloc(const char *, int id, resource_size_t, size_t);