Devicetree
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: Jaedon Shin <jaedon.shin@gmail.com>
Cc: Brian Norris <computersforpeace@gmail.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	Tejun Heo <tj@kernel.org>, Kishon Vijay Abraham I <kishon@ti.com>,
	Ralf Baechle <ralf@linux-mips.org>,
	Rob Herring <robh+dt@kernel.org>,
	Kevin Cernekee <cernekee@gmail.com>,
	Dragan Stancevic <dragan.stancevic@gmail.com>,
	linux-ide@vger.kernel.org, Linux-MIPS <linux-mips@linux-mips.org>,
	devicetree@vger.kernel.org
Subject: Re: [v2 06/10] phy: phy_brcmstb_sata: add data for phy version
Date: Sat, 31 Oct 2015 16:20:24 +0100	[thread overview]
Message-ID: <7143236.HOM9hXl6B3@wuerfel> (raw)
In-Reply-To: <1445928491-7320-7-git-send-email-jaedon.shin@gmail.com>

On Tuesday 27 October 2015 15:48:07 Jaedon Shin wrote:
> 
>  static const struct of_device_id brcm_sata_phy_of_match[] = {
> -       { .compatible   = "brcm,bcm7445-sata-phy" },
> +       { .compatible   = "brcm,bcm7445-sata-phy",
> +         .data = (void *)BRCM_SATA_PHY_28NM },
>         {},
>  };
>  MODULE_DEVICE_TABLE(of, brcm_sata_phy_of_match);
> @@ -135,6 +145,7 @@ static int brcm_sata_phy_probe(struct platform_device *pdev)
>  {
>         struct device *dev = &pdev->dev;
>         struct device_node *dn = dev->of_node, *child;
> +       const struct of_device_id *of_id;
>         struct brcm_sata_phy *priv;
>         struct resource *res;
>         struct phy_provider *provider;
> @@ -154,6 +165,12 @@ static int brcm_sata_phy_probe(struct platform_device *pdev)
>         if (IS_ERR(priv->phy_base))
>                 return PTR_ERR(priv->phy_base);
>  
> +       of_id = of_match_node(brcm_sata_phy_of_match, dn);
> +       if (of_id)
> +               priv->version = (enum brcm_sata_phy_version)of_id->data;
> +       else
> +               priv->version = BRCM_SATA_PHY_28NM;
> +
> 

As you don't actually use that variable except to set the 'offset' for
phy_base, it would be nicer to use a structure that you can point to:

struct brcm_sata_phy_data {
	unsigned long offset;
};

const struct brcm_sata_phy_data brcm_sata_phy_28nm = {
	.offset = SATA_MDIO_REG_28NM_SPACE_SIZE,
};

static const struct of_device_id brcm_sata_phy_of_match[] = {
	{ .compatible   = "brcm,bcm7445-sata-phy", .data = &brcm_sata_phy_28nm },
	{},
};

	Arnd

  reply	other threads:[~2015-10-31 15:20 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-27  6:48 [v2 00/10] add support SATA for BMIPS_GENERIC Jaedon Shin
     [not found] ` <1445928491-7320-1-git-send-email-jaedon.shin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-10-27  6:48   ` [v2 01/10] ata: ahci_brcmstb: add quick for broken ncq Jaedon Shin
2015-10-27 15:46     ` Florian Fainelli
2015-10-27  6:48   ` [v2 02/10] ata: ahci_brcmstb: add support MIPS-based platforms Jaedon Shin
     [not found]     ` <1445928491-7320-3-git-send-email-jaedon.shin-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-10-27 16:35       ` Brian Norris
2015-10-27  6:48   ` [v2 10/10] MIPS: BMIPS: brcmstb: add SATA/PHY nodes for bcm7362 Jaedon Shin
2015-10-27  6:48 ` [v2 03/10] ata: ahci_brcmstb: add quick for broken phy Jaedon Shin
2015-10-27  8:17   ` Rob Herring
2015-10-27  9:55     ` Jaedon Shin
2015-10-27 15:54   ` Florian Fainelli
2015-10-27  6:48 ` [v2 04/10] ata: ahci_brcmstb: remove unused definitions Jaedon Shin
2015-10-27  6:48 ` [v2 05/10] phy: phy_brcmstb_sata: remove duplicate definitions Jaedon Shin
2015-10-27  6:48 ` [v2 06/10] phy: phy_brcmstb_sata: add data for phy version Jaedon Shin
2015-10-31 15:20   ` Arnd Bergmann [this message]
2015-10-27  6:48 ` [v2 07/10] phy: phy_brcmstb_sata: add support MIPS-based platforms Jaedon Shin
2015-10-27 19:28   ` Rob Herring
2015-10-27  6:48 ` [v2 08/10] MIPS: BMIPS: brcmstb: add SATA/PHY nodes for bcm7425 Jaedon Shin
2015-10-27  6:48 ` [v2 09/10] MIPS: BMIPS: brcmstb: add SATA/PHY nodes for bcm7346 Jaedon Shin

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=7143236.HOM9hXl6B3@wuerfel \
    --to=arnd@arndb.de \
    --cc=cernekee@gmail.com \
    --cc=computersforpeace@gmail.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dragan.stancevic@gmail.com \
    --cc=f.fainelli@gmail.com \
    --cc=jaedon.shin@gmail.com \
    --cc=kishon@ti.com \
    --cc=linux-ide@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=ralf@linux-mips.org \
    --cc=robh+dt@kernel.org \
    --cc=tj@kernel.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