From patchwork Fri May 28 05:26:55 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: wan zongshun X-Patchwork-Id: 102890 Received: from comal.ext.ti.com (comal.ext.ti.com [198.47.26.152]) by demeter.kernel.org (8.14.3/8.14.3) with ESMTP id o4SD63HB024753 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 28 May 2010 13:06:39 GMT Received: from dlep33.itg.ti.com ([157.170.170.112]) by comal.ext.ti.com (8.13.7/8.13.7) with ESMTP id o4SD4CCd015868 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Fri, 28 May 2010 08:04:13 -0500 Received: from linux.omap.com (localhost [127.0.0.1]) by dlep33.itg.ti.com (8.13.7/8.13.7) with ESMTP id o4SD4CFc026373; Fri, 28 May 2010 08:04:12 -0500 (CDT) Received: from linux.omap.com (localhost [127.0.0.1]) by linux.omap.com (Postfix) with ESMTP id 7989D80627; Fri, 28 May 2010 08:04:11 -0500 (CDT) X-Original-To: davinci-linux-open-source@linux.davincidsp.com Delivered-To: davinci-linux-open-source@linux.davincidsp.com Received: from dflp51.itg.ti.com (dflp51.itg.ti.com [128.247.22.94]) by linux.omap.com (Postfix) with ESMTP id 902BF80626 for ; Fri, 28 May 2010 00:27:07 -0500 (CDT) Received: from medina.ext.ti.com (localhost [127.0.0.1]) by dflp51.itg.ti.com (8.13.7/8.13.7) with ESMTP id o4S5R7IZ020302 for ; Fri, 28 May 2010 00:27:07 -0500 (CDT) Received: from psmtp.com (na3sys009amx221.postini.com [74.125.149.61]) by medina.ext.ti.com (8.13.7/8.13.7) with SMTP id o4S5R630020493 for ; Fri, 28 May 2010 00:27:06 -0500 Received: from source ([74.125.83.173]) by na3sys009amx221.postini.com ([74.125.148.10]) with SMTP; Thu, 27 May 2010 22:27:07 PDT Received: by pvg12 with SMTP id 12so397562pvg.4 for ; Thu, 27 May 2010 22:27:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from :user-agent:mime-version:to:subject:content-type :content-transfer-encoding; bh=eS8REQ2IwPtMD7dBl3x+B0yXs4tbfsEYdPrL5nsdi8g=; b=iM3dp2j/QnvvLX0YCDLnFw1Av9xLeIgrC/wuabvWJmen3DCYoLAHfYKpXAKcuOZv4Y lbMMZGzPwnaEoxT7pNAs22lkOXcQTOedkkPR8GxNstwsDRxWyTugfb0If87YhdtDfE9A Hed+vtn90K1LvQrxg2e4VJqs62PJzhuLoK5j4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; b=mQF5obl5O7mDsJ/9p5WtdjVztUyUrCw4K+LaUViOxBkJDHJulDBiH/UUF309q4XiYN UAKLuQQAFka7SPBoLXL0SexPt3dHg57BdOjqylC7fGn6pUiy8SyGjHjrloF4eTr2I8It 0hcNdaD6HxpNhEnp0Fo5sNzIerxDpg7H4ucKw= Received: by 10.142.247.33 with SMTP id u33mr7681413wfh.44.1275024425885; Thu, 27 May 2010 22:27:05 -0700 (PDT) Received: from [192.168.1.10] ([116.226.201.224]) by mx.google.com with ESMTPS id c22sm16407171wam.18.2010.05.27.22.27.01 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 27 May 2010 22:27:05 -0700 (PDT) Message-ID: <4BFF541F.2080209@gmail.com> Date: Fri, 28 May 2010 13:26:55 +0800 From: Wan ZongShun User-Agent: Thunderbird 2.0.0.24 (X11/20100411) MIME-Version: 1.0 To: davinci-linux-open-source@linux.davincidsp.com, alsa-devel , Mark Brown Subject: [PATCH] ALSA/davinci: Use the resource_size , __devinit and __devexit. X-pstn-neptune: 0/0/0.00/0 X-pstn-levels: (S: 6.75280/99.90000 CV:99.9000 FC:95.5390 LC:95.5390 R:95.9108 P:95.9108 M:97.0282 C:98.6951 ) X-pstn-settings: 2 (0.5000:0.5000) s cv gt3 gt2 gt1 r p m c X-pstn-addresses: from [db-null] X-Mailman-Approved-At: Fri, 28 May 2010 08:04:10 -0500 X-BeenThere: davinci-linux-open-source@linux.davincidsp.com X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: davinci-linux-open-source-bounces@linux.davincidsp.com Errors-To: davinci-linux-open-source-bounces@linux.davincidsp.com X-Greylist: Sender succeeded STARTTLS authentication, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Fri, 28 May 2010 13:06:40 +0000 (UTC) diff --git a/sound/soc/davinci/davinci-i2s.c b/sound/soc/davinci/davinci-i2s.c index adadcd3..763ba73 100644 --- a/sound/soc/davinci/davinci-i2s.c +++ b/sound/soc/davinci/davinci-i2s.c @@ -521,7 +521,7 @@ struct snd_soc_dai davinci_i2s_dai = { }; EXPORT_SYMBOL_GPL(davinci_i2s_dai); -static int davinci_i2s_probe(struct platform_device *pdev) +static int __devinit davinci_i2s_probe(struct platform_device *pdev) { struct snd_platform_data *pdata = pdev->dev.platform_data; struct davinci_mcbsp_dev *dev; @@ -534,7 +534,7 @@ static int davinci_i2s_probe(struct platform_device *pdev) return -ENODEV; } - ioarea = request_mem_region(mem->start, (mem->end - mem->start) + 1, + ioarea = request_mem_region(mem->start, resource_size(mem), pdev->name); if (!ioarea) { dev_err(&pdev->dev, "McBSP region already claimed\n"); @@ -597,12 +597,12 @@ static int davinci_i2s_probe(struct platform_device *pdev) err_free_mem: kfree(dev); err_release_region: - release_mem_region(mem->start, (mem->end - mem->start) + 1); + release_mem_region(mem->start, resource_size(mem)); return ret; } -static int davinci_i2s_remove(struct platform_device *pdev) +static int __devexit davinci_i2s_remove(struct platform_device *pdev) { struct davinci_mcbsp_dev *dev = davinci_i2s_dai.private_data; struct resource *mem; @@ -613,14 +613,14 @@ static int davinci_i2s_remove(struct platform_device *pdev) dev->clk = NULL; kfree(dev); mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); - release_mem_region(mem->start, (mem->end - mem->start) + 1); + release_mem_region(mem->start, resource_size(mem)); return 0; } static struct platform_driver davinci_mcbsp_driver = { .probe = davinci_i2s_probe, - .remove = davinci_i2s_remove, + .remove = __devexit_p(davinci_i2s_remove), .driver = { .name = "davinci-asp", .owner = THIS_MODULE, diff --git a/sound/soc/davinci/davinci-mcasp.c b/sound/soc/davinci/davinci-mcasp.c index 79f0f4a..bd328d6 100644 --- a/sound/soc/davinci/davinci-mcasp.c +++ b/sound/soc/davinci/davinci-mcasp.c @@ -844,7 +844,7 @@ struct snd_soc_dai davinci_mcasp_dai[] = { }; EXPORT_SYMBOL_GPL(davinci_mcasp_dai); -static int davinci_mcasp_probe(struct platform_device *pdev) +static int __devinit davinci_mcasp_probe(struct platform_device *pdev) { struct davinci_pcm_dma_params *dma_data; struct resource *mem, *ioarea, *res; @@ -864,7 +864,7 @@ static int davinci_mcasp_probe(struct platform_device *pdev) } ioarea = request_mem_region(mem->start, - (mem->end - mem->start) + 1, pdev->name); + resource_size(mem), pdev->name); if (!ioarea) { dev_err(&pdev->dev, "Audio region already claimed\n"); ret = -EBUSY; @@ -928,14 +928,14 @@ static int davinci_mcasp_probe(struct platform_device *pdev) return 0; err_release_region: - release_mem_region(mem->start, (mem->end - mem->start) + 1); + release_mem_region(mem->start, resource_size(mem)); err_release_data: kfree(dev); return ret; } -static int davinci_mcasp_remove(struct platform_device *pdev) +static int __devexit davinci_mcasp_remove(struct platform_device *pdev) { struct snd_platform_data *pdata = pdev->dev.platform_data; struct davinci_audio_dev *dev; @@ -948,7 +948,7 @@ static int davinci_mcasp_remove(struct platform_device *pdev) dev->clk = NULL; mem = platform_get_resource(pdev, IORESOURCE_MEM, 0); - release_mem_region(mem->start, (mem->end - mem->start) + 1); + release_mem_region(mem->start, resource_size(mem)); kfree(dev); @@ -957,7 +957,7 @@ static int davinci_mcasp_remove(struct platform_device *pdev) static struct platform_driver davinci_mcasp_driver = { .probe = davinci_mcasp_probe, - .remove = davinci_mcasp_remove, + .remove = __devexit_p(davinci_mcasp_remove), .driver = { .name = "davinci-mcasp", .owner = THIS_MODULE,