linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: andrew@lunn.ch (Andrew Lunn)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 3/4] SATA: MV: Add support for the optional PHYs
Date: Thu, 19 Dec 2013 20:10:27 +0100	[thread overview]
Message-ID: <20131219191027.GI4143@lunn.ch> (raw)
In-Reply-To: <20131218121313.GC4324@htj.dyndns.org>

On Wed, Dec 18, 2013 at 07:13:13AM -0500, Tejun Heo wrote:
> Hello,
> 
> On Wed, Dec 18, 2013 at 12:00:10PM +0530, Kishon Vijay Abraham I wrote:
> > > @@ -4097,6 +4109,10 @@ static int mv_platform_probe(struct platform_device *pdev)
> > >  		hpriv->port_clks[port] = clk_get(&pdev->dev, port_number);
> > >  		if (!IS_ERR(hpriv->port_clks[port]))
> > >  			clk_prepare_enable(hpriv->port_clks[port]);
> > > +		sprintf(port_number, "port%d", port);
> > > +		hpriv->port_phys[port] = devm_phy_get(&pdev->dev, port_number);
> > > +		if (!IS_ERR(hpriv->port_phys[port]))
> > > +			phy_power_on(hpriv->port_phys[port]);
> 
> Shouldn't it distinguish between failures and at least produce
> warning?  ie. phy not available and phy init failed due to memory
> pressure or whatnot shouldn't be handled the same.

Phy not available is not an error, since not all variants of the SATA
IP block have the ability to control the phy. I can however add a
warning for real errors.

> > > @@ -4132,6 +4148,8 @@ err:
> > >  			clk_disable_unprepare(hpriv->port_clks[port]);
> > >  			clk_put(hpriv->port_clks[port]);
> > >  		}
> > > +		if (!IS_ERR(hpriv->port_phys[port]))
> > > +			phy_power_off(hpriv->port_phys[port]);
> 
> And I'd much prefer the array holds either NULL or valid pointer.

I was trying to keep the code similar to the clk handling. However now
that it is diverging more and more from how clk is handled, i can add
yet more divergence and overwrite the error with a NULL.

    Andrew

  reply	other threads:[~2013-12-19 19:10 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-17 20:21 [PATCH 1/4] Phy: DT binding documentation for Marvell MVEBU SATA phy Andrew Lunn
2013-12-17 20:21 ` [PATCH 2/4] Phy: Add a PHY driver for Marvell MVEBU SATA PHY Andrew Lunn
2013-12-19 10:40   ` Kishon Vijay Abraham I
2013-12-17 20:21 ` [PATCH 3/4] SATA: MV: Add support for the optional PHYs Andrew Lunn
2013-12-18  6:30   ` Kishon Vijay Abraham I
2013-12-18 12:13     ` Tejun Heo
2013-12-19 19:10       ` Andrew Lunn [this message]
2013-12-19 19:42         ` Tejun Heo
2013-12-19 19:03     ` Andrew Lunn
2013-12-20  3:25       ` Jason Cooper
2013-12-17 20:21 ` [PATCH 4/4] Phy: Add DT nodes on kirkwood and Dove for the SATA PHY Andrew Lunn
2013-12-18  6:32   ` Kishon Vijay Abraham I
2013-12-22 17:21   ` Jason Cooper
2013-12-17 20:27 ` [PATCH 1/4] Phy: DT binding documentation for Marvell MVEBU SATA phy Andrew Lunn
2013-12-20  3:21 ` Jason Cooper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131219191027.GI4143@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).