Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a166c368 authored by Sebastian Ott's avatar Sebastian Ott Committed by Martin Schwidefsky
Browse files

s390/cio: add test for ccwgroup device



Add a test to check if a given device is a ccwgroup device.

Signed-off-by: default avatarSebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent 19965230
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -73,4 +73,14 @@ extern void ccwgroup_remove_ccwdev(struct ccw_device *cdev);

#define to_ccwgroupdev(x) container_of((x), struct ccwgroup_device, dev)
#define to_ccwgroupdrv(x) container_of((x), struct ccwgroup_driver, driver)

#if IS_ENABLED(CONFIG_CCWGROUP)
bool dev_is_ccwgroup(struct device *dev);
#else /* CONFIG_CCWGROUP */
static inline bool dev_is_ccwgroup(struct device *dev)
{
	return false;
}
#endif /* CONFIG_CCWGROUP */

#endif
+6 −0
Original line number Diff line number Diff line
@@ -561,6 +561,12 @@ static struct bus_type ccwgroup_bus_type = {
	.pm = &ccwgroup_pm_ops,
};

bool dev_is_ccwgroup(struct device *dev)
{
	return dev->bus == &ccwgroup_bus_type;
}
EXPORT_SYMBOL(dev_is_ccwgroup);

/**
 * ccwgroup_driver_register() - register a ccw group driver
 * @cdriver: driver to be registered