Here is the patch with the capitalization change.  Let me know if you still 
want me to change the other code in the detect logic.

Attachment: busdriver_api_change.patch
Description: Binary data


On Jul 6, 2011, at 10:05 PM, Mike Frysinger wrote:

> On Wednesday, July 06, 2011 22:30:18 Jonathan Stroud wrote:
>> +typedef enum URJ_BUS_TYPE
>> +{
>> +    urj_bus_type_parallel,
>> +    urj_bus_type_spi,
>> +    urj_bus_type_i2c,
>> +} 
>> +urj_bus_class_t;
> 
> the convention is for enums to be all caps.  so this should be 
> URJ_BUS_TYPE_{PARALLEL,SPI,I2C}.
> 
>> --- src/flash/cfi.c  (revision 1965)
>> +++ src/flash/cfi.c  (working copy)
>> @@ -100,6 +100,8 @@
>>     if (URJ_BUS_AREA (bus, adr, &area) != URJ_STATUS_OK)
>>         // retain error state
>>         return URJ_STATUS_FAIL;
>> +    if (URJ_BUS_TYPE (bus) != urj_bus_type_parallel)
>> +        return URJ_STATUS_FAIL;
> 
> i cant think of a case where the flash driver would work on multiple buses.  
> in my experience, the protocol has been tied pretty close to the bus (which 
> kind of makes sense since the bus interface dictates heavily the 
> communication 
> spec so as to optimize transfers).  so what if we also add a "urj_bus_class_t 
> bus_type" to the urj_flash_driver_t structure, and then the common code can 
> take care of only calling the detect funcs when the bus's type and the 
> flash's 
> bus type match.
> -mike

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
_______________________________________________
UrJTAG-development mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/urjtag-development

Reply via email to