struct fwnode_handle *fwnode = dev_fwnode(&gdev->dev);
int ret;
- gdev->dev.bus = &gpio_bus_type;
-
/*
* If fwnode doesn't belong to another device, it's safe to clear its
* initialized flag.
* then make sure they get free():ed there.
*/
gdev->dev.type = &gpio_dev_type;
+ gdev->dev.bus = &gpio_bus_type;
gdev->dev.parent = gc->parent;
device_set_node(&gdev->dev, gpiochip_choose_fwnode(gc));
* we get a device node entry in sysfs under
* /sys/bus/gpio/devices/gpiochipN/dev that can be used for
* coldplug of device nodes and other udev business.
- * We can do this only if gpiolib has been initialized
- * (i.e., `gpio_bus_type` is ready). Otherwise, defer until later.
+ * We can do this only if gpiolib has been initialized.
+ * Otherwise, defer until later.
*/
if (gpiolib_initialized) {
ret = gpiochip_setup_dev(gc);