bus.c (762f99f4f3cb41a775b5157dd761217beba65873) bus.c (d01387fc16421cbbf95d1fda8fe1258195396c64)
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>

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

162 put_device(dev);
163 } while (dev);
164
165 put_device(dev);
166
167 return valid;
168}
169
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>

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

162 put_device(dev);
163 } while (dev);
164
165 put_device(dev);
166
167 return valid;
168}
169
170struct ffa_device *ffa_device_register(const uuid_t *uuid, int vm_id)
170struct ffa_device *ffa_device_register(const uuid_t *uuid, int vm_id,
171 const struct ffa_dev_ops *ops)
171{
172 int ret;
173 struct device *dev;
174 struct ffa_device *ffa_dev;
175
176 ffa_dev = kzalloc(sizeof(*ffa_dev), GFP_KERNEL);
177 if (!ffa_dev)
178 return NULL;
179
180 dev = &ffa_dev->dev;
181 dev->bus = &ffa_bus_type;
182 dev->release = ffa_release_device;
183 dev_set_name(&ffa_dev->dev, "arm-ffa-%04x", vm_id);
184
185 ffa_dev->vm_id = vm_id;
172{
173 int ret;
174 struct device *dev;
175 struct ffa_device *ffa_dev;
176
177 ffa_dev = kzalloc(sizeof(*ffa_dev), GFP_KERNEL);
178 if (!ffa_dev)
179 return NULL;
180
181 dev = &ffa_dev->dev;
182 dev->bus = &ffa_bus_type;
183 dev->release = ffa_release_device;
184 dev_set_name(&ffa_dev->dev, "arm-ffa-%04x", vm_id);
185
186 ffa_dev->vm_id = vm_id;
187 ffa_dev->ops = ops;
186 uuid_copy(&ffa_dev->uuid, uuid);
187
188 ret = device_register(&ffa_dev->dev);
189 if (ret) {
190 dev_err(dev, "unable to register device %s err=%d\n",
191 dev_name(dev), ret);
192 put_device(dev);
193 return NULL;

--- 25 unchanged lines hidden ---
188 uuid_copy(&ffa_dev->uuid, uuid);
189
190 ret = device_register(&ffa_dev->dev);
191 if (ret) {
192 dev_err(dev, "unable to register device %s err=%d\n",
193 dev_name(dev), ret);
194 put_device(dev);
195 return NULL;

--- 25 unchanged lines hidden ---