Changeset View
Changeset View
Standalone View
Standalone View
sys/arm/freescale/imx/imx_i2c.c
Context not available. | |||||
i2c_attach(device_t dev) | i2c_attach(device_t dev) | ||||
{ | { | ||||
struct i2c_softc *sc; | struct i2c_softc *sc; | ||||
phandle_t node; | |||||
device_t iic_dev; | |||||
sc = device_get_softc(dev); | sc = device_get_softc(dev); | ||||
sc->dev = dev; | sc->dev = dev; | ||||
Context not available. | |||||
} | } | ||||
bus_generic_attach(dev); | bus_generic_attach(dev); | ||||
return (0); | |||||
/* register actual iic access device */ | |||||
node = ofw_bus_get_node(dev); | |||||
iic_dev = device_find_child(sc->iicbus, "iic", -1); | |||||
OF_device_register_xref(OF_xref_from_node(node), iic_dev); | |||||
ian: This doesn't seem right. The iic device exists just to provide /dev/iicN for userland access. | |||||
mmelUnsubmitted Not Done Inline ActionsRight. And registration of ofw_iicbus was added in r292157. mmel: Right. And registration of ofw_iicbus was added in r292157. | |||||
gonzoAuthorUnsubmitted Not Done Inline ActionsThanks for committing it upstream, I removed this workaround gonzo: Thanks for committing it upstream, I removed this workaround | |||||
return (IIC_NOERR); | |||||
} | } | ||||
static int | static int | ||||
Context not available. |
This doesn't seem right. The iic device exists just to provide /dev/iicN for userland access.
I think sc->iicbus should be registered as the provider for the xref, because the usage is iicbus_transfer() which wants the device_t of the bus and calls IICBUS_TRANSFER(device_get_parent(bus)) which gets control into this driver.
If it's working with the iic device, it seems like it must be by accident.