Linux-Next discussions
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Konrad Dybcio <konradybcio@kernel.org>,
	Bjorn Andersson <andersson@kernel.org>,
	Andy Gross <agross@kernel.org>
Cc: Kees Cook <kees@kernel.org>, Kees Cook <kees+treewide@kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Linux Next Mailing List <linux-next@vger.kernel.org>,
	Stanislav Aleksandrov <lightofmysoul@gmail.com>
Subject: linux-next: manual merge of the qcom tree with the origin tree
Date: Thu, 3 Dec 2026 14:47:54 +0000	[thread overview]
Message-ID: <axGBGheKvl63LxtD@sirena.org.uk> (raw)

[-- Attachment #1: Type: text/plain, Size: 5168 bytes --]

Hi all,

Today's linux-next merge of the qcom tree got a conflict in:

  drivers/clk/qcom/clk-ref.c

between commit:

  4dd10fbbeb9c3 ("treewide: Convert devm_kmalloc() family to the devm_kmalloc_obj() family")

from the origin tree and commit:

  bd5d4cb7ebeed ("clk: qcom: common: Register clk_ref clocks from qcom_cc_desc")

from the qcom tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

diff --combined drivers/clk/qcom/clk-ref.c
index 91113743e0bed,a0013a1d9c0e6..0000000000000
--- a/drivers/clk/qcom/clk-ref.c
+++ b/drivers/clk/qcom/clk-ref.c
@@@ -13,6 -13,8 +13,8 @@@
  #include <linux/regulator/consumer.h>
  #include <linux/slab.h>
  
+ #include "common.h"
+ 
  #define QCOM_CLK_REF_EN_MASK BIT(0)
  
  struct qcom_clk_ref_provider {
@@@ -96,63 -98,45 +98,45 @@@ static const struct clk_ops qcom_clk_re
  	.is_enabled = qcom_clk_ref_is_enabled,
  };
  
- static int qcom_clk_ref_register(struct device *dev, struct regmap *regmap,
- 				 struct qcom_clk_ref *clk_refs,
- 				 const struct qcom_clk_ref_desc * const *descs,
- 				 size_t num_clk_refs)
+ int qcom_clk_ref_register(struct device *dev, struct regmap *regmap,
+ 			  struct qcom_clk_ref *clk_ref,
+ 			  const struct qcom_clk_ref_desc *desc)
  {
- 	const struct qcom_clk_ref_desc *desc;
  	struct clk_init_data init_data = {};
- 	struct qcom_clk_ref *clk_ref;
- 	size_t clk_idx;
  	unsigned int i;
  	int ret;
  
- 	for (clk_idx = 0; clk_idx < num_clk_refs; clk_idx++) {
- 		clk_ref = &clk_refs[clk_idx];
- 		desc = descs[clk_idx];
+ 	if (WARN_ON(!desc->name))
+ 		return -EINVAL;
  
- 		/* Skip unpopulated indices; the array is indexed by clock ID. */
- 		if (!desc)
- 			continue;
+ 	clk_ref->regmap = regmap;
+ 	clk_ref->desc = *desc;
  
- 		if (WARN_ON(!desc->name))
- 			continue;
+ 	if (clk_ref->desc.num_regulators) {
+ 		clk_ref->regulators = devm_kzalloc_objs(dev, *clk_ref->regulators,
+ 							clk_ref->desc.num_regulators);
+ 		if (!clk_ref->regulators)
+ 			return -ENOMEM;
  
- 		clk_ref->regmap = regmap;
- 		clk_ref->desc = *desc;
+ 		for (i = 0; i < clk_ref->desc.num_regulators; i++)
+ 			clk_ref->regulators[i].supply =
+ 				clk_ref->desc.regulator_names[i];
  
- 		if (clk_ref->desc.num_regulators) {
- 			clk_ref->regulators = devm_kzalloc_objs(dev,
- 								*clk_ref->regulators,
- 								clk_ref->desc.num_regulators);
- 			if (!clk_ref->regulators)
- 				return -ENOMEM;
- 
- 			for (i = 0; i < clk_ref->desc.num_regulators; i++)
- 				clk_ref->regulators[i].supply =
- 					clk_ref->desc.regulator_names[i];
- 
- 			ret = devm_regulator_bulk_get(dev, clk_ref->desc.num_regulators,
- 						      clk_ref->regulators);
- 			if (ret)
- 				return dev_err_probe(dev, ret,
- 						     "Failed to get regulators for %s\n",
- 						     clk_ref->desc.name);
- 		}
- 
- 		init_data.name = clk_ref->desc.name;
- 		init_data.parent_data = &qcom_clk_ref_parent_data;
- 		init_data.num_parents = 1;
- 		init_data.ops = &qcom_clk_ref_ops;
- 		clk_ref->hw.init = &init_data;
- 
- 		ret = devm_clk_hw_register(dev, &clk_ref->hw);
+ 		ret = devm_regulator_bulk_get(dev, clk_ref->desc.num_regulators,
+ 					      clk_ref->regulators);
  		if (ret)
- 			return ret;
+ 			return dev_err_probe(dev, ret,
+ 					     "Failed to get regulators for %s\n",
+ 					     clk_ref->desc.name);
  	}
  
- 	return 0;
+ 	init_data.name = clk_ref->desc.name;
+ 	init_data.parent_data = &qcom_clk_ref_parent_data;
+ 	init_data.num_parents = 1;
+ 	init_data.ops = &qcom_clk_ref_ops;
+ 	clk_ref->hw.init = &init_data;
+ 
+ 	return devm_clk_hw_register(dev, &clk_ref->hw);
  }
  
  static struct clk_hw *qcom_clk_ref_provider_get(struct of_phandle_args *clkspec, void *data)
@@@ -178,6 -162,7 +162,7 @@@ int qcom_clk_ref_probe(struct platform_
  	struct device *dev = &pdev->dev;
  	struct regmap *regmap;
  	void __iomem *base;
+ 	size_t i;
  	int ret;
  
  	base = devm_platform_ioremap_resource(pdev, 0);
@@@ -188,16 -173,22 +173,21 @@@
  	if (IS_ERR(regmap))
  		return PTR_ERR(regmap);
  
 -	provider = devm_kzalloc(dev, struct_size(provider, refs, num_clk_refs),
 -				GFP_KERNEL);
 +	provider = devm_kzalloc_flex(dev, *provider, refs, num_clk_refs);
  	if (!provider)
  		return -ENOMEM;
  
  	provider->num_refs = num_clk_refs;
  
- 	ret = qcom_clk_ref_register(dev, regmap, provider->refs, descs,
- 				    provider->num_refs);
- 	if (ret)
- 		return ret;
+ 	for (i = 0; i < num_clk_refs; i++) {
+ 		/* Skip unpopulated indices; the array is indexed by clock ID. */
+ 		if (!descs[i])
+ 			continue;
+ 
+ 		ret = qcom_clk_ref_register(dev, regmap, &provider->refs[i], descs[i]);
+ 		if (ret)
+ 			return ret;
+ 	}
  
  	return devm_of_clk_add_hw_provider(dev, qcom_clk_ref_provider_get, provider);
  }

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

             reply	other threads:[~2026-12-03 14:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-03 14:47 Mark Brown [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-07-27 13:04 linux-next: manual merge of the qcom tree with the origin tree Mark Brown

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=axGBGheKvl63LxtD@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=agross@kernel.org \
    --cc=andersson@kernel.org \
    --cc=kees+treewide@kernel.org \
    --cc=kees@kernel.org \
    --cc=konradybcio@kernel.org \
    --cc=lightofmysoul@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-next@vger.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