bus.c (e781858488b918e30a6ff28e9eab6058b787e3b3) bus.c (3bbfe9871005f38df2955b2e125933edf1d2feef)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (C) 2021 ARM Ltd.
4 */
5
6#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
7
8#include <linux/arm_ffa.h>
9#include <linux/device.h>
10#include <linux/fs.h>
11#include <linux/kernel.h>
12#include <linux/module.h>
13#include <linux/slab.h>
14#include <linux/types.h>
15
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (C) 2021 ARM Ltd.
4 */
5
6#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
7
8#include <linux/arm_ffa.h>
9#include <linux/device.h>
10#include <linux/fs.h>
11#include <linux/kernel.h>
12#include <linux/module.h>
13#include <linux/slab.h>
14#include <linux/types.h>
15
16#include "common.h"
17
16static int ffa_device_match(struct device *dev, struct device_driver *drv)
17{
18 const struct ffa_device_id *id_table;
19 struct ffa_device *ffa_dev;
20
21 id_table = to_ffa_driver(drv)->id_table;
22 ffa_dev = to_ffa_dev(dev);
23

--- 158 unchanged lines hidden (view full) ---

182{
183 if (!ffa_dev)
184 return;
185
186 device_unregister(&ffa_dev->dev);
187}
188EXPORT_SYMBOL_GPL(ffa_device_unregister);
189
18static int ffa_device_match(struct device *dev, struct device_driver *drv)
19{
20 const struct ffa_device_id *id_table;
21 struct ffa_device *ffa_dev;
22
23 id_table = to_ffa_driver(drv)->id_table;
24 ffa_dev = to_ffa_dev(dev);
25

--- 158 unchanged lines hidden (view full) ---

184{
185 if (!ffa_dev)
186 return;
187
188 device_unregister(&ffa_dev->dev);
189}
190EXPORT_SYMBOL_GPL(ffa_device_unregister);
191
190static int __init arm_ffa_bus_init(void)
192int arm_ffa_bus_init(void)
191{
192 return bus_register(&ffa_bus_type);
193}
193{
194 return bus_register(&ffa_bus_type);
195}
194module_init(arm_ffa_bus_init);
195
196
196static void __exit arm_ffa_bus_exit(void)
197void arm_ffa_bus_exit(void)
197{
198 ffa_devices_unregister();
199 bus_unregister(&ffa_bus_type);
200}
198{
199 ffa_devices_unregister();
200 bus_unregister(&ffa_bus_type);
201}
201
202module_exit(arm_ffa_bus_exit);
203
204MODULE_ALIAS("arm-ffa-bus");
205MODULE_AUTHOR("Sudeep Holla <sudeep.holla@arm.com>");
206MODULE_DESCRIPTION("Arm FF-A bus driver");
207MODULE_LICENSE("GPL v2");