X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=sound%2Fppc%2Fbeep.c;h=baa2a7237370af2db7a0160e8bcc5502b82b945f;hb=3af73d392c9c414ca527bab9c5d4c2a97698acbd;hp=5f38f670102c8940bedc6d90b56d5e8be32e754b;hpb=db1a19b38f3a85f475b4ad716c71be133d8ca48e;p=linux-2.6-omap-h63xx.git diff --git a/sound/ppc/beep.c b/sound/ppc/beep.c index 5f38f670102..baa2a723737 100644 --- a/sound/ppc/beep.c +++ b/sound/ppc/beep.c @@ -18,7 +18,6 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include #include #include #include @@ -118,7 +117,7 @@ static int snd_pmac_beep_event(struct input_dev *dev, unsigned int type, default: return -1; } - chip = dev->private; + chip = input_get_drvdata(dev); if (! chip || (beep = chip->beep) == NULL) return -1; @@ -195,10 +194,13 @@ static int snd_pmac_put_beep(struct snd_kcontrol *kcontrol, struct snd_ctl_elem_value *ucontrol) { struct snd_pmac *chip = snd_kcontrol_chip(kcontrol); - int oval; + unsigned int oval, nval; snd_assert(chip->beep, return -ENXIO); oval = chip->beep->volume; - chip->beep->volume = ucontrol->value.integer.value[0]; + nval = ucontrol->value.integer.value[0]; + if (nval > 100) + return -EINVAL; + chip->beep->volume = nval; return oval != chip->beep->volume; } @@ -236,11 +238,11 @@ int __init snd_pmac_attach_beep(struct snd_pmac *chip) input_dev->id.product = 0x0001; input_dev->id.version = 0x0100; - input_dev->evbit[0] = BIT(EV_SND); - input_dev->sndbit[0] = BIT(SND_BELL) | BIT(SND_TONE); + input_dev->evbit[0] = BIT_MASK(EV_SND); + input_dev->sndbit[0] = BIT_MASK(SND_BELL) | BIT_MASK(SND_TONE); input_dev->event = snd_pmac_beep_event; - input_dev->private = chip; - input_dev->cdev.dev = &chip->pdev->dev; + input_dev->dev.parent = &chip->pdev->dev; + input_set_drvdata(input_dev, chip); beep->dev = input_dev; beep->buf = dmabuf; @@ -251,8 +253,8 @@ int __init snd_pmac_attach_beep(struct snd_pmac *chip) err = snd_ctl_add(chip->card, beep_ctl); if (err < 0) goto fail1; - - chip->beep = beep; + + chip->beep = beep; err = input_register_device(beep->dev); if (err)