Re: [PATCH] ATA: SATA_MV: Fix probe failure when no phy exists

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jan 31, 2014 at 12:46:19PM +0100, Andrew Lunn wrote:
> The problem here is there is a different between optional and non
> optional phys. If it is not optional, ENODEV is fatal. If it is
> optional ENODEV is not fatal. So it needs at least to be
> 
> bool is_phy_error_fatal(struct phy *phy, bool optional)
> 
> Also, EPROBE_DEFER is not fatal, but still needs the probe to return
> an error code. So the code ends up something like
> 
> 	phy = devm_phy_get(...);
>    	if (IS_ERR(phy) {
>       		if (is_phy_error_fatal(phy, true)) {
> 			dev_err(dev, "Fatal phy error);
> 	 		goto out;
>       		}
> 		if (PTR_ERR(phy) == -EPROBE_DEFER)
> 			goto out;
> 	}
> 
> I can implement this if you want.

Ugh... it's too ugly.  This really should be contained in phy layer.
How about introducing devm_phy_get_optional() which does the error
value interpretation inside it and just returns 0 if probing can go on
and -errno if it shouldn't.

Thanks.

-- 
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux