mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: stufever@gmail.com
Cc: linux-kernel@vger.kernel.org, perex@perex.cz,
	Wang Shaoyan <wangshaoyan.pt@taobao.com>
Subject: Re: [PATCH] sound: don't use the deprecated function check_region
Date: Mon, 08 Aug 2011 10:22:23 +0200	[thread overview]
Message-ID: <s5h1uwwia80.wl%tiwai@suse.de> (raw)
In-Reply-To: <1312790832-6790-1-git-send-email-wangshaoyan.pt@taobao.com>

At Mon,  8 Aug 2011 16:07:12 +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>
> ---
>  sound/oss/pss.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/sound/oss/pss.c b/sound/oss/pss.c
> index 9b800ce..0fa26bd 100644
> --- a/sound/oss/pss.c
> +++ b/sound/oss/pss.c
> @@ -673,9 +673,10 @@ 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");
>  	} else {
> +		release_region(pss_cdrom_port, 2);
>  		set_io_base(devc, CONF_CDROM, pss_cdrom_port);
>  		printk(KERN_INFO "PSS: CDROM I/O port set to 0x%x.\n", pss_cdrom_port);
>  	}

Well, this just hides the warning but doesn't fix the possible race,
which is the reason check_region() is marked as deprecated after all.

Instead of releasing the resource there, keep it and release in the
destructor properly like other normal resources.


thanks,

Takashi

  reply	other threads:[~2011-08-08  8:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-08  8:07 stufever
2011-08-08  8:22 ` Takashi Iwai [this message]
2011-08-08  9:33   ` Wang Shaoyan
2011-08-08  9:43     ` Takashi Iwai
2011-08-08 10:43 stufever
2011-08-08 10:47 ` Takashi Iwai
2011-08-08 11:10 stufever
2011-08-08 12:33 ` Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=s5h1uwwia80.wl%tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=stufever@gmail.com \
    --cc=wangshaoyan.pt@taobao.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®