lkml.org 
[lkml]   [2003]   [Jan]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch, 2.5] opti92x-ad1848 one check_region fixup
On Mon, 30 Dec 2002, Marcus Alanen wrote:

> Initializes the variables (the chip->xxx stuff) before calling
> anything else. snd_legacy_find_free_ioport() uses request_region now,
> so remember to release regions in the private freeing routine
> snd_card_opti9xx_free().
>
> Note how I changed it to return SNDRV_AUTO_PORT instead of -1, I'm
> not sure if they are guaranteed to be the same, so I changed it
> instead explicitely.
>
> No other snd_legacy_find_free_ioport users in this file or elsewhere
> in the kernel.

Your patch is bad. Lowlevel drivers allocate the hardware resources (see
snd_cs4231_create() or snd_ad1848_create() code), but these functions will
fail, because you allocate resources in the top-level code. I think that
it will be sufficient to replace check_region call with request_region and
release_resource. The collision frame is so small and the code returns
with an error code when a problem occurs.

Jaroslav

-----
Jaroslav Kysela <perex@suse.cz>
Linux Kernel Sound Maintainer
ALSA Project, SuSE Labs

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:32    [W:0.036 / U:1.884 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site