File tree Expand file tree Collapse file tree 1 file changed +1
-20
lines changed Expand file tree Collapse file tree 1 file changed +1
-20
lines changed Original file line number Diff line number Diff line change @@ -680,26 +680,7 @@ struct device_link {
680
680
bool supplier_preactivated ; /* Owned by consumer probe. */
681
681
};
682
682
683
- static inline struct device * __kobj_to_dev (struct kobject * kobj )
684
- {
685
- return container_of (kobj , struct device , kobj );
686
- }
687
-
688
- static inline const struct device * __kobj_to_dev_const (const struct kobject * kobj )
689
- {
690
- return container_of (kobj , const struct device , kobj );
691
- }
692
-
693
- /*
694
- * container_of() will happily take a const * and spit back a non-const * as it
695
- * is just doing pointer math. But we want to be a bit more careful in the
696
- * driver code, so manually force any const * of a kobject to also be a const *
697
- * to a device.
698
- */
699
- #define kobj_to_dev (kobj ) \
700
- _Generic((kobj), \
701
- const struct kobject *: __kobj_to_dev_const, \
702
- struct kobject *: __kobj_to_dev)(kobj)
683
+ #define kobj_to_dev (__kobj ) container_of_const(__kobj, struct device, kobj)
703
684
704
685
/**
705
686
* device_iommu_mapped - Returns true when the device DMA is translated
You can’t perform that action at this time.
0 commit comments