Rename the channel_max method to channel_count, because that's what it's

returning.  (If the channel count is 2, then the max channel number is 1.)
This commit is contained in:
Ian Lepore 2019-06-15 21:36:14 +00:00
parent 47e17a1b1a
commit 9878710395
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=349084
4 changed files with 5 additions and 5 deletions

View File

@ -226,7 +226,7 @@ aw_pwm_detach(device_t dev)
}
static int
aw_pwm_channel_max(device_t dev, int *nchannel)
aw_pwm_channel_count(device_t dev, int *nchannel)
{
*nchannel = 1;
@ -363,7 +363,7 @@ static device_method_t aw_pwm_methods[] = {
/* pwm interface */
DEVMETHOD(pwm_get_bus, aw_pwm_get_bus),
DEVMETHOD(pwm_channel_max, aw_pwm_channel_max),
DEVMETHOD(pwm_channel_count, aw_pwm_channel_count),
DEVMETHOD(pwm_channel_config, aw_pwm_channel_config),
DEVMETHOD(pwm_channel_get_config, aw_pwm_channel_get_config),
DEVMETHOD(pwm_channel_enable, aw_pwm_channel_enable),

View File

@ -100,7 +100,7 @@ METHOD int channel_is_enabled {
#
# Get the number of channels
#
METHOD int channel_max {
METHOD int channel_count {
device_t dev;
int *nchannel;
};

View File

@ -78,7 +78,7 @@ pwmbus_attach(device_t dev)
sc->busdev = dev;
sc->dev = device_get_parent(dev);
if (PWM_CHANNEL_MAX(sc->dev, &sc->nchannels) != 0 ||
if (PWM_CHANNEL_COUNT(sc->dev, &sc->nchannels) != 0 ||
sc->nchannels == 0)
return (ENXIO);

View File

@ -67,7 +67,7 @@ pwm_ioctl(struct cdev *dev, u_long cmd, caddr_t data,
switch (cmd) {
case PWMMAXCHANNEL:
nchannel = -1;
rv = PWM_CHANNEL_MAX(sc->pdev, &nchannel);
rv = PWM_CHANNEL_COUNT(sc->pdev, &nchannel);
bcopy(&nchannel, data, sizeof(nchannel));
break;
case PWMSETSTATE: