mx25l.c (75b3cfd252af255268d37ce4a3b25b9d8ce3bd9b) | mx25l.c (73a1170a8c41cb848f17cc0a8839e9dcee3d126e) |
---|---|
1/*- 2 * Copyright (c) 2006 M. Warner Losh. All rights reserved. 3 * Copyright (c) 2009 Oleksandr Tymoshenko. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 175 unchanged lines hidden (view full) --- 184 err = SPIBUS_TRANSFER(device_get_parent(dev), dev, &cmd); 185 if (err) 186 return (NULL); 187 188 manufacturer_id = rxBuf[1]; 189 dev_id = (rxBuf[2] << 8) | (rxBuf[3]); 190 191 for (i = 0; | 1/*- 2 * Copyright (c) 2006 M. Warner Losh. All rights reserved. 3 * Copyright (c) 2009 Oleksandr Tymoshenko. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 175 unchanged lines hidden (view full) --- 184 err = SPIBUS_TRANSFER(device_get_parent(dev), dev, &cmd); 185 if (err) 186 return (NULL); 187 188 manufacturer_id = rxBuf[1]; 189 dev_id = (rxBuf[2] << 8) | (rxBuf[3]); 190 191 for (i = 0; |
192 i < sizeof(flash_devices)/sizeof(struct mx25l_flash_ident); i++) { | 192 i < nitems(flash_devices); i++) { |
193 if ((flash_devices[i].manufacturer_id == manufacturer_id) && 194 (flash_devices[i].device_id == dev_id)) 195 return &flash_devices[i]; 196 } 197 198 printf("Unknown SPI flash device. Vendor: %02x, device id: %04x\n", 199 manufacturer_id, dev_id); 200 return (NULL); --- 424 unchanged lines hidden --- | 193 if ((flash_devices[i].manufacturer_id == manufacturer_id) && 194 (flash_devices[i].device_id == dev_id)) 195 return &flash_devices[i]; 196 } 197 198 printf("Unknown SPI flash device. Vendor: %02x, device id: %04x\n", 199 manufacturer_id, dev_id); 200 return (NULL); --- 424 unchanged lines hidden --- |