@@ -209,14 +209,21 @@ struct iommu_ops {
209209 * instance
210210 * @list: Used by the iommu-core to keep a list of registered iommus
211211 * @ops: iommu-ops for talking to this iommu
212+ * @dev: struct device for sysfs handling
212213 */
213214struct iommu_device {
214215 struct list_head list ;
215216 const struct iommu_ops * ops ;
217+ struct device dev ;
216218};
217219
218220int iommu_device_register (struct iommu_device * iommu );
219221void iommu_device_unregister (struct iommu_device * iommu );
222+ int iommu_device_sysfs_add (struct iommu_device * iommu ,
223+ struct device * parent ,
224+ const struct attribute_group * * groups ,
225+ const char * fmt , ...) __printf (4 , 5 );
226+ void iommu_device_sysfs_remove (struct iommu_device * iommu );
220227
221228static inline void iommu_device_set_ops (struct iommu_device * iommu ,
222229 const struct iommu_ops * ops )
@@ -287,10 +294,6 @@ extern int iommu_domain_get_attr(struct iommu_domain *domain, enum iommu_attr,
287294 void * data );
288295extern int iommu_domain_set_attr (struct iommu_domain * domain , enum iommu_attr ,
289296 void * data );
290- struct device * iommu_device_create (struct device * parent , void * drvdata ,
291- const struct attribute_group * * groups ,
292- const char * fmt , ...) __printf (4 , 5 );
293- void iommu_device_destroy (struct device * dev );
294297int iommu_device_link (struct device * dev , struct device * link );
295298void iommu_device_unlink (struct device * dev , struct device * link );
296299
@@ -567,29 +570,29 @@ static inline int iommu_domain_set_attr(struct iommu_domain *domain,
567570 return - EINVAL ;
568571}
569572
570- static inline struct device * iommu_device_create (struct device * parent ,
571- void * drvdata ,
572- const struct attribute_group * * groups ,
573- const char * fmt , ...)
573+ static inline int iommu_device_register (struct iommu_device * iommu )
574574{
575- return ERR_PTR ( - ENODEV ) ;
575+ return - ENODEV ;
576576}
577577
578- static inline void iommu_device_destroy (struct device * dev )
578+ static inline void iommu_device_set_ops (struct iommu_device * iommu ,
579+ const struct iommu_ops * ops )
579580{
580581}
581582
582- static inline int iommu_device_register (struct iommu_device * iommu )
583+ static inline void iommu_device_unregister (struct iommu_device * iommu )
583584{
584- return - ENODEV ;
585585}
586586
587- static inline void iommu_device_set_ops (struct iommu_device * iommu ,
588- const struct iommu_ops * ops )
587+ static inline int iommu_device_sysfs_add (struct iommu_device * iommu ,
588+ struct device * parent ,
589+ const struct attribute_group * * groups ,
590+ const char * fmt , ...)
589591{
592+ return - ENODEV ;
590593}
591594
592- static inline void iommu_device_unregister (struct iommu_device * iommu )
595+ static inline void iommu_device_sysfs_remove (struct iommu_device * iommu )
593596{
594597}
595598
0 commit comments