Skip to content

Commit 045a704

Browse files
committed
iommu: Rename struct iommu_param to dev_iommu
The term dev_iommu aligns better with other existing structures and their accessor functions. Signed-off-by: Joerg Roedel <[email protected]> Tested-by: Will Deacon <[email protected]> # arm-smmu Reviewed-by: Jean-Philippe Brucker <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 8c3d692 commit 045a704

File tree

3 files changed

+19
-19
lines changed

3 files changed

+19
-19
lines changed

drivers/iommu/iommu.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,9 @@ void iommu_device_unregister(struct iommu_device *iommu)
152152
}
153153
EXPORT_SYMBOL_GPL(iommu_device_unregister);
154154

155-
static struct iommu_param *iommu_get_dev_param(struct device *dev)
155+
static struct dev_iommu *dev_iommu_get(struct device *dev)
156156
{
157-
struct iommu_param *param = dev->iommu_param;
157+
struct dev_iommu *param = dev->iommu;
158158

159159
if (param)
160160
return param;
@@ -164,14 +164,14 @@ static struct iommu_param *iommu_get_dev_param(struct device *dev)
164164
return NULL;
165165

166166
mutex_init(&param->lock);
167-
dev->iommu_param = param;
167+
dev->iommu = param;
168168
return param;
169169
}
170170

171-
static void iommu_free_dev_param(struct device *dev)
171+
static void dev_iommu_free(struct device *dev)
172172
{
173-
kfree(dev->iommu_param);
174-
dev->iommu_param = NULL;
173+
kfree(dev->iommu);
174+
dev->iommu = NULL;
175175
}
176176

177177
int iommu_probe_device(struct device *dev)
@@ -183,7 +183,7 @@ int iommu_probe_device(struct device *dev)
183183
if (!ops)
184184
return -EINVAL;
185185

186-
if (!iommu_get_dev_param(dev))
186+
if (!dev_iommu_get(dev))
187187
return -ENOMEM;
188188

189189
if (!try_module_get(ops->owner)) {
@@ -200,7 +200,7 @@ int iommu_probe_device(struct device *dev)
200200
err_module_put:
201201
module_put(ops->owner);
202202
err_free_dev_param:
203-
iommu_free_dev_param(dev);
203+
dev_iommu_free(dev);
204204
return ret;
205205
}
206206

@@ -211,9 +211,9 @@ void iommu_release_device(struct device *dev)
211211
if (dev->iommu_group)
212212
ops->remove_device(dev);
213213

214-
if (dev->iommu_param) {
214+
if (dev->iommu) {
215215
module_put(ops->owner);
216-
iommu_free_dev_param(dev);
216+
dev_iommu_free(dev);
217217
}
218218
}
219219

@@ -972,7 +972,7 @@ int iommu_register_device_fault_handler(struct device *dev,
972972
iommu_dev_fault_handler_t handler,
973973
void *data)
974974
{
975-
struct iommu_param *param = dev->iommu_param;
975+
struct dev_iommu *param = dev->iommu;
976976
int ret = 0;
977977

978978
if (!param)
@@ -1015,7 +1015,7 @@ EXPORT_SYMBOL_GPL(iommu_register_device_fault_handler);
10151015
*/
10161016
int iommu_unregister_device_fault_handler(struct device *dev)
10171017
{
1018-
struct iommu_param *param = dev->iommu_param;
1018+
struct dev_iommu *param = dev->iommu;
10191019
int ret = 0;
10201020

10211021
if (!param)
@@ -1055,7 +1055,7 @@ EXPORT_SYMBOL_GPL(iommu_unregister_device_fault_handler);
10551055
*/
10561056
int iommu_report_device_fault(struct device *dev, struct iommu_fault_event *evt)
10571057
{
1058-
struct iommu_param *param = dev->iommu_param;
1058+
struct dev_iommu *param = dev->iommu;
10591059
struct iommu_fault_event *evt_pending = NULL;
10601060
struct iommu_fault_param *fparam;
10611061
int ret = 0;
@@ -1104,7 +1104,7 @@ int iommu_page_response(struct device *dev,
11041104
int ret = -EINVAL;
11051105
struct iommu_fault_event *evt;
11061106
struct iommu_fault_page_request *prm;
1107-
struct iommu_param *param = dev->iommu_param;
1107+
struct dev_iommu *param = dev->iommu;
11081108
struct iommu_domain *domain = iommu_get_domain_for_dev(dev);
11091109

11101110
if (!domain || !domain->ops->page_response)

include/linux/device.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ struct iommu_ops;
4444
struct iommu_group;
4545
struct iommu_fwspec;
4646
struct dev_pin_info;
47-
struct iommu_param;
47+
struct dev_iommu;
4848

4949
/**
5050
* struct subsys_interface - interfaces to device functions
@@ -514,7 +514,7 @@ struct dev_links_info {
514514
* device (i.e. the bus driver that discovered the device).
515515
* @iommu_group: IOMMU group the device belongs to.
516516
* @iommu_fwspec: IOMMU-specific properties supplied by firmware.
517-
* @iommu_param: Per device generic IOMMU runtime data
517+
* @iommu: Per device generic IOMMU runtime data
518518
*
519519
* @offline_disabled: If set, the device is permanently online.
520520
* @offline: Set after successful invocation of bus type's .offline().
@@ -614,7 +614,7 @@ struct device {
614614
void (*release)(struct device *dev);
615615
struct iommu_group *iommu_group;
616616
struct iommu_fwspec *iommu_fwspec;
617-
struct iommu_param *iommu_param;
617+
struct dev_iommu *iommu;
618618

619619
bool offline_disabled:1;
620620
bool offline:1;

include/linux/iommu.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -365,15 +365,15 @@ struct iommu_fault_param {
365365
};
366366

367367
/**
368-
* struct iommu_param - collection of per-device IOMMU data
368+
* struct dev_iommu - Collection of per-device IOMMU data
369369
*
370370
* @fault_param: IOMMU detected device fault reporting data
371371
*
372372
* TODO: migrate other per device data pointers under iommu_dev_data, e.g.
373373
* struct iommu_group *iommu_group;
374374
* struct iommu_fwspec *iommu_fwspec;
375375
*/
376-
struct iommu_param {
376+
struct dev_iommu {
377377
struct mutex lock;
378378
struct iommu_fault_param *fault_param;
379379
};

0 commit comments

Comments
 (0)