public inbox for devicetree@vger.kernel.org
 help / color / mirror / Atom feed
From: Luca Weiss <luca@z3ntu.xyz>
To: Bartosz Dudziak <bartosz.dudziak@snejp.pl>,
	~postmarketos/upstreaming@lists.sr.ht
Cc: Andy Gross <agross@kernel.org>,
	Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@kernel.org>, Rob Herring <robh+dt@kernel.org>,
	Jeffrey Hugo <jhugo@codeaurora.org>,
	Taniya Das <tdas@codeaurora.org>,
	linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	~postmarketos/upstreaming@lists.sr.ht,
	Bjorn Andersson <bjorn.andersson@linaro.org>
Subject: Re: [PATCH 2/2] clk: qcom: Add MSM8226 Multimedia Clock Controller support
Date: Wed, 26 Jan 2022 23:40:36 +0100	[thread overview]
Message-ID: <6707575.DvuYhMxLoT@g550jk> (raw)
In-Reply-To: <Ya42ZAKupwKiWpJf@builder.lan>

Hi Bartosz,

are you planning to work on this? If not I can pick it up and make a v2.
Please let me know!

Regards
Luca

On Montag, 6. Dezember 2021 17:12:20 CET Bjorn Andersson wrote:
> On Fri 12 Nov 19:58 CST 2021, Bartosz Dudziak wrote:
> > diff --git a/drivers/clk/qcom/mmcc-msm8974.c
> > b/drivers/clk/qcom/mmcc-msm8974.c
> [..]
> 
> >  static int mmcc_msm8974_probe(struct platform_device *pdev)
> >  {
> >  
> >  	struct regmap *regmap;
> > 
> > +	const struct of_device_id *match;
> > +
> > +	match = of_match_device(mmcc_msm8974_match_table, &pdev->dev);
> 
> Could you please use of_device_get_match_data() instead?
> 
> > +	if (!match)
> 
> As a general suggestion; I don't see how we would end up here with
> !match, but if we somehow do it would be during development and you
> would have an easier time debugging this by hitting a NULL pointer
> dereference with a callstack, than tracking down why your clocks are
> missing...
> 
> Thanks,
> Bjorn
> 
> > +		return -ENODEV;
> > 
> > -	regmap = qcom_cc_map(pdev, &mmcc_msm8974_desc);
> > +	regmap = qcom_cc_map(pdev, match->data);
> > 
> >  	if (IS_ERR(regmap))
> >  	
> >  		return PTR_ERR(regmap);
> > 
> > -	clk_pll_configure_sr_hpm_lp(&mmpll1, regmap, &mmpll1_config, true);
> > -	clk_pll_configure_sr_hpm_lp(&mmpll3, regmap, &mmpll3_config, false);
> > +	if (match->data == &mmcc_msm8974_desc) {
> > +		clk_pll_configure_sr_hpm_lp(&mmpll1, regmap, 
&mmpll1_config, true);
> > +		clk_pll_configure_sr_hpm_lp(&mmpll3, regmap, 
&mmpll3_config, false);
> > +	} else {
> > +		msm8226_clock_override();
> > +	}
> > 
> > -	return qcom_cc_really_probe(pdev, &mmcc_msm8974_desc, regmap);
> > +	return qcom_cc_really_probe(pdev, match->data, regmap);
> > 
> >  }
> >  
> >  static struct platform_driver mmcc_msm8974_driver = {





  reply	other threads:[~2022-01-26 22:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-13  1:58 [PATCH 1/2] dt-bindings: clock: Add support for the MSM8226 mmcc Bartosz Dudziak
2021-11-13  1:58 ` [PATCH 2/2] clk: qcom: Add MSM8226 Multimedia Clock Controller support Bartosz Dudziak
2021-11-13 12:09   ` Luca Weiss
2021-12-06 16:12   ` Bjorn Andersson
2022-01-26 22:40     ` Luca Weiss [this message]
2021-11-29 21:20 ` [PATCH 1/2] dt-bindings: clock: Add support for the MSM8226 mmcc Rob Herring

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=6707575.DvuYhMxLoT@g550jk \
    --to=luca@z3ntu.xyz \
    --cc=agross@kernel.org \
    --cc=bartosz.dudziak@snejp.pl \
    --cc=bjorn.andersson@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jhugo@codeaurora.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=robh+dt@kernel.org \
    --cc=sboyd@kernel.org \
    --cc=tdas@codeaurora.org \
    --cc=~postmarketos/upstreaming@lists.sr.ht \
    /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