i2ctinyusb.c (54e231b373ef617c348706c6c64a2e049ea738ec) | i2ctinyusb.c (18250ec6c089c0c50cbd9fd87d78e03ff89916df) |
---|---|
1/*- 2 * Copyright (c) 2024 Denis Bodor <dbodor@rollmops.ninja> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 159 unchanged lines hidden (view full) --- 168 mtx_init(&sc->sc_mtx, "i2ctinyusb lock", NULL, MTX_DEF | MTX_RECURSE); 169 170 sc->iicbus_dev = device_add_child(dev, "iicbus", -1); 171 if (sc->iicbus_dev == NULL) { 172 device_printf(dev, "iicbus creation failed\n"); 173 err = ENXIO; 174 goto detach; 175 } | 1/*- 2 * Copyright (c) 2024 Denis Bodor <dbodor@rollmops.ninja> 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 159 unchanged lines hidden (view full) --- 168 mtx_init(&sc->sc_mtx, "i2ctinyusb lock", NULL, MTX_DEF | MTX_RECURSE); 169 170 sc->iicbus_dev = device_add_child(dev, "iicbus", -1); 171 if (sc->iicbus_dev == NULL) { 172 device_printf(dev, "iicbus creation failed\n"); 173 err = ENXIO; 174 goto detach; 175 } |
176 err = bus_generic_attach(dev); | 176 bus_attach_children(dev); |
177 178 return (0); 179 180detach: 181 i2ctinyusb_detach(dev); 182 return (err); 183} 184 --- 118 unchanged lines hidden --- | 177 178 return (0); 179 180detach: 181 i2ctinyusb_detach(dev); 182 return (err); 183} 184 --- 118 unchanged lines hidden --- |