[EMS] Markus Plessing wrote:
> Wolfgang Grandegger schrieb:
>> Markus Plessing wrote:
>>> Replaced the removed cs_error function and fixed other minor issues
>>> introduced with the following commit in net-next-2.6.
>>> net-next-2.6 --- commit 5fa9167a1bf5f5a4b7282f5e7ac56a4a5a1fa044
>>>
>>> The new maintainer is set to be the MODULE_AUTHOR and an additional
>>> line of copyright has been added.
>>>
>>> Signed-off-by: Markus Plessing <[email protected]>
>>> ---
>>>
>>> Index: kernel/2.6/drivers/net/can/sja1000/ems_pcmcia.c
>>> ===================================================================
>>> --- kernel/2.6/drivers/net/can/sja1000/ems_pcmcia.c    (Revision 1126)
>>> +++ kernel/2.6/drivers/net/can/sja1000/ems_pcmcia.c    (Arbeitskopie)
>>> @@ -1,5 +1,6 @@
>>>  /*
>>>   * Copyright (C) 2008 Sebastian Haas <[email protected]>
>>> + * Copyright (C) 2010 Markus Plessing <[email protected]>
>>>   *
>>>   * This program is free software; you can redistribute it and/or modify
>>>   * it under the terms of the version 2 of the GNU General Public
>>> License
>>> @@ -40,7 +41,7 @@
>>>  #error This driver does not support Kernel versions < 2.6.16
>>>  #endif
>>>  
>>> -MODULE_AUTHOR("Sebastian Haas <[email protected]>");
>>> +MODULE_AUTHOR("Markus Plessing <[email protected]>");
>>>  MODULE_DESCRIPTION("Socket-CAN driver for EMS CPC-CARD cards");
>>>  MODULE_SUPPORTED_DEVICE("EMS CPC-CARD CAN card");
>>>  MODULE_LICENSE("GPL v2");
>>> @@ -344,7 +345,6 @@
>>>  
>>>      /* Interrupt setup */
>>>      dev->irq.Attributes = IRQ_TYPE_DYNAMIC_SHARING;
>>> -    dev->irq.IRQInfo1 = IRQ_LEVEL_ID;
>>>  
>>>      /* General socket configuration */
>>>      dev->conf.Attributes = CONF_ENABLE_IRQ;
>>> @@ -352,7 +352,7 @@
>>>      dev->conf.ConfigIndex = 1;
>>>      dev->conf.Present = PRESENT_OPTION;
>>>  
>>> -    dev->win = NULL;
>>> +    dev->win = 0;
>>>  
>>>      ems_pcmcia_config(dev);
>>>  
>>> @@ -374,31 +374,35 @@
>>>      req.Base = req.Size = 0;
>>>      req.AccessSpeed = 0;
>>>  
>>> -    csval = pcmcia_request_window(&dev, &req, &dev->win);
>>> +    csval = pcmcia_request_window(dev, &req, &dev->win);
>>>      if (csval) {
>>> -        cs_error(dev, RequestWindow, csval);
>>> +        dev_err(&dev->dev, "RequestWindow failed (err=%d)\n",
>>> +            csval);
>>>          return;
>>>      }
>>>  
>>>      mem.CardOffset = mem.Page = 0;
>>>      mem.CardOffset = dev->conf.ConfigBase;
>>>  
>>> -    csval = pcmcia_map_mem_page(dev->win, &mem);
>>> +    csval = pcmcia_map_mem_page(dev, dev->win, &mem);
>>>      if (csval) {
>>> -        cs_error(dev, MapMemPage, csval);
>>> +        dev_err(&dev->dev, "MapMemPage failed (err=%d)\n",
>>> +            csval);
>>>          return;
>>>      }
>>>  
>>>      csval = pcmcia_request_irq(dev, &dev->irq);
>>>      if (csval) {
>>> -        cs_error(dev, RequestIRQ, csval);
>>> +        dev_err(&dev->dev, "RequestIRQ failed (err=%d)\n",
>>> +            csval);
>>>          return;
>>>      }
>>>  
>>>      /* This actually configures the PCMCIA socket */
>>>      csval = pcmcia_request_configuration(dev, &dev->conf);
>>>      if (csval) {
>>> -        cs_error(dev, RequestConfiguration, csval);
>>> +        dev_err(&dev->dev, "RequestConfig failed (err=%d)\n",
>>> +            csval);
>>>          return;
>>>      }
>>
>> Does tihs patch still work with older kernel versions? I think you need
>> to take care using "#if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,16)".
> 
> Kernel version 2,6,16 does not make much sense, but its a example I
> think. cs_error / CS_CHECK / CONFIG_PCMCIA_DEBUG are completely removed
> in kernel version 2.6.33, so this may be the version for the check?

Yes.

> Ok, I'll try a code example. If this is acceptable, i'll submit it again
> without the MODULE_AUTHOR change and these version checks?
> 
> ------------------------------------------------------------------------
> 
>     /* This actually configures the PCMCIA socket */
>       csval = pcmcia_request_configuration(dev, &dev->conf);
>     if (csval) {
> #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,33)
>         cs_error(dev, RequestConfiguration, csval);
> #else
>         dev_err(&dev->dev, "RequestConfig failed (err=%d)\n",
>             csval);
> #fi

#endif !

>     }

Wolfgang.
_______________________________________________
Socketcan-core mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/socketcan-core

Reply via email to