@@ -2805,25 +2805,20 @@ set_initial_features(void)
28052805 /* Enable GMAC for now for PCI probing. It will be disabled
28062806 * later on after PCI probe
28072807 */
2808- np = of_find_node_by_name (NULL , "ethernet" );
2809- while (np ) {
2808+ for_each_node_by_name (np , "ethernet" )
28102809 if (of_device_is_compatible (np , "K2-GMAC" ))
28112810 g5_gmac_enable (np , 0 , 1 );
2812- np = of_find_node_by_name (np , "ethernet" );
2813- }
28142811
28152812 /* Enable FW before PCI probe. Will be disabled later on
28162813 * Note: We should have a batter way to check that we are
28172814 * dealing with uninorth internal cell and not a PCI cell
28182815 * on the external PCI. The code below works though.
28192816 */
2820- np = of_find_node_by_name (NULL , "firewire" );
2821- while (np ) {
2817+ for_each_node_by_name (np , "firewire" ) {
28222818 if (of_device_is_compatible (np , "pci106b,5811" )) {
28232819 macio_chips [0 ].flags |= MACIO_FLAG_FW_SUPPORTED ;
28242820 g5_fw_enable (np , 0 , 1 );
28252821 }
2826- np = of_find_node_by_name (np , "firewire" );
28272822 }
28282823 }
28292824#else /* CONFIG_POWER4 */
@@ -2834,22 +2829,19 @@ set_initial_features(void)
28342829 /* Enable GMAC for now for PCI probing. It will be disabled
28352830 * later on after PCI probe
28362831 */
2837- np = of_find_node_by_name (NULL , "ethernet" );
2838- while (np ) {
2832+ for_each_node_by_name (np , "ethernet" ) {
28392833 if (np -> parent
28402834 && of_device_is_compatible (np -> parent , "uni-north" )
28412835 && of_device_is_compatible (np , "gmac" ))
28422836 core99_gmac_enable (np , 0 , 1 );
2843- np = of_find_node_by_name (np , "ethernet" );
28442837 }
28452838
28462839 /* Enable FW before PCI probe. Will be disabled later on
28472840 * Note: We should have a batter way to check that we are
28482841 * dealing with uninorth internal cell and not a PCI cell
28492842 * on the external PCI. The code below works though.
28502843 */
2851- np = of_find_node_by_name (NULL , "firewire" );
2852- while (np ) {
2844+ for_each_node_by_name (np , "firewire" ) {
28532845 if (np -> parent
28542846 && of_device_is_compatible (np -> parent , "uni-north" )
28552847 && (of_device_is_compatible (np , "pci106b,18" ) ||
@@ -2858,18 +2850,16 @@ set_initial_features(void)
28582850 macio_chips [0 ].flags |= MACIO_FLAG_FW_SUPPORTED ;
28592851 core99_firewire_enable (np , 0 , 1 );
28602852 }
2861- np = of_find_node_by_name (np , "firewire" );
28622853 }
28632854
28642855 /* Enable ATA-100 before PCI probe. */
28652856 np = of_find_node_by_name (NULL , "ata-6" );
2866- while (np ) {
2857+ for_each_node_by_name (np , "ata-6" ) {
28672858 if (np -> parent
28682859 && of_device_is_compatible (np -> parent , "uni-north" )
28692860 && of_device_is_compatible (np , "kauai-ata" )) {
28702861 core99_ata100_enable (np , 1 );
28712862 }
2872- np = of_find_node_by_name (np , "ata-6" );
28732863 }
28742864
28752865 /* Switch airport off */
0 commit comments