Commit ee2b6d37 authored by David S. Miller's avatar David S. Miller

Sparc SBUS fix: Make for_all_sbusdev work with an empty SBUS.

parent 8cb95e05
...@@ -94,7 +94,8 @@ sbus_is_slave(struct sbus_dev *dev) ...@@ -94,7 +94,8 @@ sbus_is_slave(struct sbus_dev *dev)
for((device) = (bus)->devices; (device); (device)=(device)->next) for((device) = (bus)->devices; (device); (device)=(device)->next)
#define for_all_sbusdev(device, bus) \ #define for_all_sbusdev(device, bus) \
for((bus) = sbus_root, ((device) = (bus) ? (bus)->devices : 0); (bus); (device)=((device)->next ? (device)->next : ((bus) = (bus)->next, (bus) ? (bus)->devices : 0))) for ((bus) = sbus_root; (bus); (bus) = (bus)->next) \
for ((device) = (bus)->devices; (device); (device) = (device)->next)
/* Driver DVMA interfaces. */ /* Driver DVMA interfaces. */
#define sbus_can_dma_64bit(sdev) (0) /* actually, sparc_cpu_model==sun4d */ #define sbus_can_dma_64bit(sdev) (0) /* actually, sparc_cpu_model==sun4d */
......
...@@ -87,7 +87,8 @@ extern struct sbus_bus *sbus_root; ...@@ -87,7 +87,8 @@ extern struct sbus_bus *sbus_root;
for((device) = (bus)->devices; (device); (device)=(device)->next) for((device) = (bus)->devices; (device); (device)=(device)->next)
#define for_all_sbusdev(device, bus) \ #define for_all_sbusdev(device, bus) \
for((bus) = sbus_root, ((device) = (bus) ? (bus)->devices : 0); (bus); (device)=((device)->next ? (device)->next : ((bus) = (bus)->next, (bus) ? (bus)->devices : 0))) for ((bus) = sbus_root; (bus); (bus) = (bus)->next) \
for ((device) = (bus)->devices; (device); (device) = (device)->next)
/* Driver DVMA interfaces. */ /* Driver DVMA interfaces. */
#define sbus_can_dma_64bit(sdev) (1) #define sbus_can_dma_64bit(sdev) (1)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment