public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Soha Jin <soha@lohu.info>
Cc: Giuseppe Cavallaro <peppe.cavallaro@st.com>,
	Alexandre Torgue <alexandre.torgue@foss.st.com>,
	Jose Abreu <joabreu@synopsys.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Yangyu Chen <cyy@cyyself.name>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/3] net: stmmac: use fwnode instead of of to configure driver
Date: Mon, 10 Oct 2022 22:38:17 +0200	[thread overview]
Message-ID: <Y0SCuaVpAnbpMk72@lunn.ch> (raw)
In-Reply-To: <20221009162247.1336-2-soha@lohu.info>

> -	axi->axi_lpi_en = of_property_read_bool(np, "snps,lpi_en");
> -	axi->axi_xit_frm = of_property_read_bool(np, "snps,xit_frm");
> -	axi->axi_kbbe = of_property_read_bool(np, "snps,axi_kbbe");
> -	axi->axi_fb = of_property_read_bool(np, "snps,axi_fb");
> -	axi->axi_mb = of_property_read_bool(np, "snps,axi_mb");
> -	axi->axi_rb =  of_property_read_bool(np, "snps,axi_rb");
> +	axi->axi_lpi_en = fwnode_property_read_bool(fwnode, "snps,lpi_en");
> +	axi->axi_xit_frm = fwnode_property_read_bool(fwnode, "snps,xit_frm");
> +	axi->axi_kbbe = fwnode_property_read_bool(fwnode, "snps,axi_kbbe");
> +	axi->axi_fb = fwnode_property_read_bool(fwnode, "snps,axi_fb");
> +	axi->axi_mb = fwnode_property_read_bool(fwnode, "snps,axi_mb");
> +	axi->axi_rb =  fwnode_property_read_bool(fwnode, "snps,axi_rb");
>  
> -	if (of_property_read_u32(np, "snps,wr_osr_lmt", &axi->axi_wr_osr_lmt))
> +	if (fwnode_property_read_u32(fwnode, "snps,wr_osr_lmt",
> +				     &axi->axi_wr_osr_lmt))
>  		axi->axi_wr_osr_lmt = 1;
> -	if (of_property_read_u32(np, "snps,rd_osr_lmt", &axi->axi_rd_osr_lmt))
> +	if (fwnode_property_read_u32(fwnode, "snps,rd_osr_lmt",
> +				     &axi->axi_rd_osr_lmt))
>  		axi->axi_rd_osr_lmt = 1;
> -	of_property_read_u32_array(np, "snps,blen", axi->axi_blen, AXI_BLEN);
> -	of_node_put(np);
> +	fwnode_property_read_u32_array(fwnode, "snps,blen", axi->axi_blen,
> +				       AXI_BLEN);
> +	fwnode_handle_put(fwnode);

None of these are documented as being valid in ACPI. Do you need to
ensure they only come from DT, or you document them for ACPI, and get
the ACPI maintainers to ACK that they are O.K.

>  
>  	return axi;
>  }
>  
>  /**
> - * stmmac_mtl_setup - parse DT parameters for multiple queues configuration
> + * stmmac_mtl_setup - parse properties for multiple queues configuration
>   * @pdev: platform device
>   * @plat: enet data
>   */
>  static int stmmac_mtl_setup(struct platform_device *pdev,
>  			    struct plat_stmmacenet_data *plat)
>  {
> -	struct device_node *q_node;
> -	struct device_node *rx_node;
> -	struct device_node *tx_node;
> +	struct fwnode_handle *fwnode = dev_fwnode(&pdev->dev);
> +	struct fwnode_handle *q_node;
> +	struct fwnode_handle *rx_node;
> +	struct fwnode_handle *tx_node;
>  	u8 queue = 0;
>  	int ret = 0;
>  
> -	/* For backwards-compatibility with device trees that don't have any
> +	/* For backwards-compatibility with properties that don't have any
>  	 * snps,mtl-rx-config or snps,mtl-tx-config properties, we fall back
>  	 * to one RX and TX queues each.
>  	 */

Backward compatibility only applies to DT. Anybody using ACPI should
not expect any backwards compatibility, they should be documented
mandatory properties right from the beginning.

	  Andrew

  parent reply	other threads:[~2022-10-10 20:39 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-09 16:22 [PATCH 0/3] net: stmmac: probing config with fwnode instead of of Soha Jin
2022-10-09 16:22 ` [PATCH 1/3] net: stmmac: use fwnode instead of of to configure driver Soha Jin
2022-10-09 19:43   ` kernel test robot
2022-10-09 19:54   ` kernel test robot
2022-10-10 20:38   ` Andrew Lunn [this message]
2022-10-11  3:12     ` Soha Jin
2022-10-11 12:41       ` Andrew Lunn
2022-10-09 16:22 ` [PATCH 2/3] net: stmmac: add Phytium's PHYT0004 to dwmac-generic compatible devices Soha Jin
2022-10-09 16:22 ` [PATCH 3/3] net: stmmac: switch to stmmac_platform_{probe,remove}_config Soha Jin

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=Y0SCuaVpAnbpMk72@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=alexandre.torgue@foss.st.com \
    --cc=cyy@cyyself.name \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=joabreu@synopsys.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=peppe.cavallaro@st.com \
    --cc=soha@lohu.info \
    /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