PERFORCE change 222055 for review
Bjoern A. Zeeb
bz at FreeBSD.org
Fri Feb 15 12:19:05 UTC 2013
http://p4web.freebsd.org/@@222055?ac=10
Change 222055 by bz at bz_zenith on 2013/02/15 12:18:57
Try to read the Ethernet config space from cfi as well if isf fails.
Rename the local varibale and fix a bug releasing on the wrong
device resource previously.
Affected files ...
.. //depot/projects/ctsrd/beribsd/src/sys/dev/altera/atse/if_atse.c#13 edit
Differences ...
==== //depot/projects/ctsrd/beribsd/src/sys/dev/altera/atse/if_atse.c#13 (text+ko) ====
@@ -630,18 +630,21 @@
atse_ethernet_option_bits_read_fdt(device_t dev)
{
struct resource *res;
- device_t isfdev;
+ device_t fdev;
int i, rid;
if (atse_ethernet_option_bits_flag & ATSE_ETHERNET_OPTION_BITS_READ)
return (0);
- isfdev = device_find_child(device_get_parent(dev), "isf", 0);
- if (isfdev == NULL)
- return (ENOENT);
+ fdev = device_find_child(device_get_parent(dev), "isf", 0);
+ if (fdev == NULL) {
+ fdev = device_find_child(device_get_parent(dev), "cfi", 0);
+ if (fdev == NULL)
+ return (ENOENT);
+ }
rid = 0;
- res = bus_alloc_resource_any(isfdev, SYS_RES_MEMORY, &rid,
+ res = bus_alloc_resource_any(fdev, SYS_RES_MEMORY, &rid,
RF_ACTIVE | RF_SHAREABLE);
if (res == NULL)
return (ENXIO);
@@ -650,7 +653,7 @@
atse_ethernet_option_bits[i] = bus_read_1(res,
ALTERA_ETHERNET_OPTION_BITS_OFF + i);
- bus_release_resource(dev, SYS_RES_MEMORY, rid, res);
+ bus_release_resource(fdev, SYS_RES_MEMORY, rid, res);
atse_ethernet_option_bits_flag |= ATSE_ETHERNET_OPTION_BITS_READ;
return (0);
More information about the p4-projects
mailing list