lkml.org 
[lkml]   [2011]   [Aug]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] sound: don't use the deprecated function check_region
At Mon,  8 Aug 2011 18:43:15 +0800,
stufever@gmail.com wrote:
>
> From: Wang Shaoyan <wangshaoyan.pt@taobao.com>
>
> sound/oss/pss.c: In function 'configure_nonsound_components':
> sound/oss/pss.c:676: warning: 'check_region' is deprecated (declared at include/linux/ioport.h:201)
>
> Signed-off-by: Wang Shaoyan <wangshaoyan.pt@taobao.com>

Thanks, it's getting better, but a still bit things to fix...

> ---
> sound/oss/pss.c | 11 +++++------
> 1 files changed, 5 insertions(+), 6 deletions(-)
>
> diff --git a/sound/oss/pss.c b/sound/oss/pss.c
> index 9b800ce..55bfea6 100644
> --- a/sound/oss/pss.c
> +++ b/sound/oss/pss.c
> @@ -673,7 +673,7 @@ static void configure_nonsound_components(void)
>
> if (pss_cdrom_port == -1) { /* If cdrom port enablation wasn't requested */
> printk(KERN_INFO "PSS: CDROM port not enabled.\n");
> - } else if (check_region(pss_cdrom_port, 2)) {
> + } else if (!request_region(pss_cdrom_port, 2, "PSS CDROM")) {
> printk(KERN_ERR "PSS: CDROM I/O port conflict.\n");

In the error path, set pss_cdrom_port to -1 so that it won't be
released wrongly later.

> } else {
> set_io_base(devc, CONF_CDROM, pss_cdrom_port);
> @@ -1223,8 +1223,7 @@ static int __init init_pss(void)
>
> static void __exit cleanup_pss(void)
> {
> - if(!pss_no_sound)
> - {
> + if (!pss_no_sound) {
> if(fw_load && pss_synth)
> vfree(pss_synth);
> if(pssmss)

Not necessary to fix the coding style in the same patch.

> @@ -1232,10 +1231,10 @@ static void __exit cleanup_pss(void)
> if(pssmpu)
> unload_pss_mpu(&cfg_mpu);
> unload_pss(&cfg);
> - }
> + } else
> + release_region(pss_cdrom_port, 2);

Call this only when pss_cdrom_port has a valid value.


thanks,

Takashi


\
 
 \ /
  Last update: 2011-08-08 12:49    [W:1.798 / U:0.160 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site