public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Gross <andy.gross@linaro.org>
To: Austin Christ <austinwc@codeaurora.org>
Cc: wsa@the-dreams.de, linux-i2c@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	nkaje@codeaurora.org, rruigrok@codeaurora.org,
	timur@codeaurora.org, cov@codeaurora.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 1/2][v3] i2c: qup: add ACPI support
Date: Sun, 5 Jun 2016 13:57:50 -0500	[thread overview]
Message-ID: <20160605185750.GF13357@hector.attlocal.net> (raw)
In-Reply-To: <1464291477-4705-1-git-send-email-austinwc@codeaurora.org>

On Thu, May 26, 2016 at 01:37:56PM -0600, Austin Christ wrote:

<snip>

> @@ -1354,14 +1359,13 @@ static void qup_i2c_disable_clocks(struct qup_i2c_dev *qup)
>  static int qup_i2c_probe(struct platform_device *pdev)
>  {
>  	static const int blk_sizes[] = {4, 16, 32};
> -	struct device_node *node = pdev->dev.of_node;
>  	struct qup_i2c_dev *qup;
>  	unsigned long one_bit_t;
>  	struct resource *res;
>  	u32 io_mode, hw_ver, size;
>  	int ret, fs_div, hs_div;
> -	int src_clk_freq;
> -	u32 clk_freq = 100000;
> +	u32 src_clk_freq = 0;
> +	u32 clk_freq = 0;
>  	int blocks;
>  
>  	qup = devm_kzalloc(&pdev->dev, sizeof(*qup), GFP_KERNEL);
> @@ -1372,7 +1376,12 @@ static int qup_i2c_probe(struct platform_device *pdev)
>  	init_completion(&qup->xfer);
>  	platform_set_drvdata(pdev, qup);
>  
> -	of_property_read_u32(node, "clock-frequency", &clk_freq);
> +	ret = device_property_read_u32(qup->dev, "clock-frequency", &clk_freq);

Why do we need a warning if the clock-frequency is not specified?  It is
optional in the DT documentation, is it not in the ACPI?

> +	if (ret) {
> +		dev_warn(qup->dev, "using default clock-frequency %d",
> +			DEFAULT_CLK_FREQ);
> +		clk_freq = DEFAULT_CLK_FREQ;

You could just assign the DEFAULT_CLK_FREQ in the variable declaration instead
of 0.  read_property does not modify the variable unless it finds it or does the
ACPI version modify if not found?

> +	}
>  
>  	if (of_device_is_compatible(pdev->dev.of_node, "qcom,i2c-qup-v1.1.1")) {
>  		qup->adap.algo = &qup_i2c_algo;
> @@ -1454,20 +1463,31 @@ nodma:
>  		return qup->irq;
>  	}
>  

<snip>

Regards,

Andy

  parent reply	other threads:[~2016-06-05 18:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-26 19:37 [PATCH 1/2][v3] i2c: qup: add ACPI support Austin Christ
2016-05-26 19:37 ` [PATCH 2/2][v4] i2c: qup: support SMBus block read Austin Christ
2016-06-05 18:57 ` Andy Gross [this message]
2016-06-08 18:12   ` [PATCH 1/2][v3] i2c: qup: add ACPI support Christ, Austin

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=20160605185750.GF13357@hector.attlocal.net \
    --to=andy.gross@linaro.org \
    --cc=austinwc@codeaurora.org \
    --cc=cov@codeaurora.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nkaje@codeaurora.org \
    --cc=rruigrok@codeaurora.org \
    --cc=timur@codeaurora.org \
    --cc=wsa@the-dreams.de \
    /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