Spell unsigned int as u_int and channel as chan; eliminates the need to wrap

some long lines.
This commit is contained in:
Ian Lepore 2019-06-15 21:19:23 +00:00
parent cd6e47c168
commit 59d8a61ca7
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=349082

View File

@ -101,81 +101,81 @@ pwmbus_detach(device_t dev)
} }
static int static int
pwmbus_channel_config(device_t bus, int channel, unsigned int period, unsigned int duty) pwmbus_channel_config(device_t bus, int chan, u_int period, u_int duty)
{ {
struct pwmbus_softc *sc; struct pwmbus_softc *sc;
sc = device_get_softc(bus); sc = device_get_softc(bus);
if (channel > sc->nchannels) if (chan > sc->nchannels)
return (EINVAL); return (EINVAL);
return (PWM_CHANNEL_CONFIG(sc->dev, channel, period, duty)); return (PWM_CHANNEL_CONFIG(sc->dev, chan, period, duty));
} }
static int static int
pwmbus_channel_get_config(device_t bus, int channel, unsigned int *period, unsigned int *duty) pwmbus_channel_get_config(device_t bus, int chan, u_int *period, u_int *duty)
{ {
struct pwmbus_softc *sc; struct pwmbus_softc *sc;
sc = device_get_softc(bus); sc = device_get_softc(bus);
if (channel > sc->nchannels) if (chan > sc->nchannels)
return (EINVAL); return (EINVAL);
return (PWM_CHANNEL_GET_CONFIG(sc->dev, channel, period, duty)); return (PWM_CHANNEL_GET_CONFIG(sc->dev, chan, period, duty));
} }
static int static int
pwmbus_channel_set_flags(device_t bus, int channel, uint32_t flags) pwmbus_channel_set_flags(device_t bus, int chan, uint32_t flags)
{ {
struct pwmbus_softc *sc; struct pwmbus_softc *sc;
sc = device_get_softc(bus); sc = device_get_softc(bus);
if (channel > sc->nchannels) if (chan > sc->nchannels)
return (EINVAL); return (EINVAL);
return (PWM_CHANNEL_SET_FLAGS(sc->dev, channel, flags)); return (PWM_CHANNEL_SET_FLAGS(sc->dev, chan, flags));
} }
static int static int
pwmbus_channel_get_flags(device_t bus, int channel, uint32_t *flags) pwmbus_channel_get_flags(device_t bus, int chan, uint32_t *flags)
{ {
struct pwmbus_softc *sc; struct pwmbus_softc *sc;
sc = device_get_softc(bus); sc = device_get_softc(bus);
if (channel > sc->nchannels) if (chan > sc->nchannels)
return (EINVAL); return (EINVAL);
return (PWM_CHANNEL_GET_FLAGS(sc->dev, channel, flags)); return (PWM_CHANNEL_GET_FLAGS(sc->dev, chan, flags));
} }
static int static int
pwmbus_channel_enable(device_t bus, int channel, bool enable) pwmbus_channel_enable(device_t bus, int chan, bool enable)
{ {
struct pwmbus_softc *sc; struct pwmbus_softc *sc;
sc = device_get_softc(bus); sc = device_get_softc(bus);
if (channel > sc->nchannels) if (chan > sc->nchannels)
return (EINVAL); return (EINVAL);
return (PWM_CHANNEL_ENABLE(sc->dev, channel, enable)); return (PWM_CHANNEL_ENABLE(sc->dev, chan, enable));
} }
static int static int
pwmbus_channel_is_enabled(device_t bus, int channel, bool *enable) pwmbus_channel_is_enabled(device_t bus, int chan, bool *enable)
{ {
struct pwmbus_softc *sc; struct pwmbus_softc *sc;
sc = device_get_softc(bus); sc = device_get_softc(bus);
if (channel > sc->nchannels) if (chan > sc->nchannels)
return (EINVAL); return (EINVAL);
return (PWM_CHANNEL_IS_ENABLED(sc->dev, channel, enable)); return (PWM_CHANNEL_IS_ENABLED(sc->dev, chan, enable));
} }
static device_method_t pwmbus_methods[] = { static device_method_t pwmbus_methods[] = {