mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-13 14:40:22 +00:00
newbus will zero softc, so no need to duplicate the zeroing here.
Plus a minor formatting nit in nearby code.
This commit is contained in:
parent
18f1afb9f4
commit
dbafaeca13
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=157523
@ -122,15 +122,9 @@ iic_attach(device_t dev)
|
||||
{
|
||||
struct iic_softc *sc = (struct iic_softc *)device_get_softc(dev);
|
||||
|
||||
if (!sc)
|
||||
return (ENOMEM);
|
||||
|
||||
bzero(sc, sizeof(struct iic_softc));
|
||||
|
||||
sc->sc_devnode = make_dev(&iic_cdevsw, device_get_unit(dev),
|
||||
UID_ROOT, GID_WHEEL,
|
||||
0600, "iic%d", device_get_unit(dev));
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
@ -146,7 +140,7 @@ iic_detach(device_t dev)
|
||||
}
|
||||
|
||||
static int
|
||||
iicopen (struct cdev *dev, int flags, int fmt, struct thread *td)
|
||||
iicopen(struct cdev *dev, int flags, int fmt, struct thread *td)
|
||||
{
|
||||
struct iic_softc *sc = IIC_SOFTC(minor(dev));
|
||||
|
||||
|
@ -115,13 +115,9 @@ static int iicbb_attach(device_t dev)
|
||||
{
|
||||
struct iicbb_softc *sc = (struct iicbb_softc *)device_get_softc(dev);
|
||||
|
||||
bzero(sc, sizeof(struct iicbb_softc));
|
||||
|
||||
sc->iicbus = device_add_child(dev, "iicbus", -1);
|
||||
|
||||
if (!sc->iicbus)
|
||||
return (ENXIO);
|
||||
|
||||
bus_generic_attach(dev);
|
||||
|
||||
return (0);
|
||||
|
@ -153,8 +153,6 @@ iicsmb_attach(device_t dev)
|
||||
{
|
||||
struct iicsmb_softc *sc = (struct iicsmb_softc *)device_get_softc(dev);
|
||||
|
||||
bzero(sc, sizeof(*sc));
|
||||
|
||||
sc->smbus = device_add_child(dev, "smbus", -1);
|
||||
|
||||
/* probe and attach the smbus */
|
||||
|
Loading…
Reference in New Issue
Block a user