forked from mirrors/linux
		
	net: bgmac: Return PTR_ERR() for fixed_phy_register()
fixed_phy_register() returns -EPROBE_DEFER, -EINVAL and -EBUSY, etc, in addition to -ENODEV. The best practice is to return these error codes with PTR_ERR(). Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
		
							parent
							
								
									b22eef6864
								
							
						
					
					
						commit
						d6499f0b7c
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		| 
						 | 
					@ -1450,7 +1450,7 @@ int bgmac_phy_connect_direct(struct bgmac *bgmac)
 | 
				
			||||||
	phy_dev = fixed_phy_register(PHY_POLL, &fphy_status, NULL);
 | 
						phy_dev = fixed_phy_register(PHY_POLL, &fphy_status, NULL);
 | 
				
			||||||
	if (!phy_dev || IS_ERR(phy_dev)) {
 | 
						if (!phy_dev || IS_ERR(phy_dev)) {
 | 
				
			||||||
		dev_err(bgmac->dev, "Failed to register fixed PHY device\n");
 | 
							dev_err(bgmac->dev, "Failed to register fixed PHY device\n");
 | 
				
			||||||
		return -ENODEV;
 | 
							return PTR_ERR(phy_dev);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	err = phy_connect_direct(bgmac->net_dev, phy_dev, bgmac_adjust_link,
 | 
						err = phy_connect_direct(bgmac->net_dev, phy_dev, bgmac_adjust_link,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue