lkml.org 
[lkml]   [2008]   [Jul]   [28]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateMon, 28 Jul 2008 11:07:53 +0200
FromDominik Brodowski <>
SubjectRe: [PATCH] smc91c92_cs: use request_firmware
Hi,

On Mon, Jul 28, 2008 at 02:32:54PM +0530, Jaswinder Singh wrote:
> On Mon, 2008-07-28 at 10:28 +0200, Dominik Brodowski wrote:
> > > +static int osi_load_firmware(struct pcmcia_device *link)
> > > +{
> > > +	struct platform_device *pdev;
> > > +	const struct firmware *fw;
> > > +	const char fw_name[] = "ositech/Xilinx7OD.bin"; 
> > > +	int i, err;
> > > + 
> > > +	pdev = platform_device_register_simple("ositech", 0, NULL, 0);
> > 
> > Why do we need a platform_device here? Can't we just use the pcmcia device
> > (so &link->dev) here?
> > 
> 
> Thanks for pointing it out, I was searching for it.
> 
> Here is the fix:
> 
> diff --git a/drivers/net/pcmcia/smc91c92_cs.c b/drivers/net/pcmcia/smc91c92_cs.c
> index 03f9be9..43d8e23 100644
> --- a/drivers/net/pcmcia/smc91c92_cs.c
> +++ b/drivers/net/pcmcia/smc91c92_cs.c
> @@ -43,7 +43,6 @@
>  #include <linux/mii.h>
>  #include <linux/jiffies.h>
>  #include <linux/firmware.h>
> -#include <linux/platform_device.h>
> 
>  #include <pcmcia/cs_types.h>
>  #include <pcmcia/cs.h>
> @@ -794,18 +793,11 @@ static int osi_config(struct pcmcia_device *link)
> 
>  static int osi_load_firmware(struct pcmcia_device *link)
>  {
> -	struct platform_device *pdev;
>  	const struct firmware *fw;
>  	const char fw_name[] = "ositech/Xilinx7OD.bin"; 
>  	int i, err;
> 
> -	pdev = platform_device_register_simple("ositech", 0, NULL, 0);
> -	if (IS_ERR(pdev)) {
> -		printk(KERN_ERR "Failed to register platform device ositech\n");
> -		return IS_ERR(pdev);
> -	}
> -	err = request_firmware(&fw, fw_name, &pdev->dev);
> -	platform_device_unregister(pdev);
> +	err = request_firmware(&fw, fw_name, &link->dev);
>  	if (err) {
>  		printk(KERN_ERR "Failed to load firmware \"%s\"\n",
>  		       fw_name);
> 
> You can check updated patch from :-
> 
> http://git.infradead.org/users/jaswinder/firm-jsr-2.6.git

for the pcmcia aspects of this patch:
Acked-by: Dominik Brodowski <linux@dominikbrodowski.net>

Thanks!

	Dominik


\
 
 \ /
  Last update: 2008-07-28 11:11    [from the cache]
©2003-2008