From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796229894; b=vtLrMjTfhnisYtcAM254exMacSx9Rl89+ci06CXg1bJYICniRWWajiYh21psYDV9yAW3 KLs3VhhSYrXRP6GYnWmG8cKmwCZBjHivsb2H3+iLhb79zZU9UjUOxrhSFXAFAaM9tNaq6 DABxLkzd3pKrBJuuUwiW9Jzqir2ASq7gG/fEs6/6sYXRE1aougzu8+jzOUIBMxRul9ChP lptnfGz6KMWowC3KajId+OnNnIMV13hEjDtNCRPQR1rBLR3DmpPZEvetNNXjvFRzGUTh6 o2xSg9hPTcLiYieMtCFx2ysiWPUZpGq2Yx2aNapndFdl95490DLaWDeN7+jDHHH1BLw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796229894; h=Received:DKIM-Signature:Date:From:To:Cc:Subject:Message-ID: References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To: X-AI-Review-Draft; bh=F+FE2x4IoZKn3n227G0Sj2Y/nywIQliDCfZfFYAbsYk=; b=ujvtruWZM7gl/IePXN/q6qHY/hcRxooCDaCViDhi/Ph6GJVS0q9/TbfWSTMQtAjviJmQ sNBCtsY1LR4JCdU5VVhVmkH8KDEIjnwvD4fNPLMBPcA9aWuo9AzpO/6HPhUql7jvA0UfS tP+zML18hWthBjMCrBWU7xbZRhGbxrfEffMDGgSk7pLVGALMOB+4puVGWu3chVFoE08W6 SXH1dx2us5l36Iv8I5uBHIdqNs2rkyw3TZ43LUuIUJIrM5+ZR1ncuL5YzqQnZXl37o+3z FVu79eTVrhVDXg3gwCwCz5x8H320CXnoB8FiMWL4qibl4NoxCkFWorIVYnPus7tQuRQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=oLEd3bgj; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 29B59606A334; Wed, 2 Dec 2026 16:44:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=oLEd3bgj Received: by smtp.kernel.org (Postfix) with ESMTPSA id F134F1F00896; Wed, 2 Dec 2026 16:44:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796229893; bh=F+FE2x4IoZKn3n227G0Sj2Y/nywIQliDCfZfFYAbsYk=; h=Date:From:To:Cc:Subject:References:In-Reply-To; b=oLEd3bgjryoRrO8wYsN6nFnJe97oXM56jbMYx/vPgka+sF1PFnuoy4GDyve8VbNM+ 3ZOACSQdsH3BW2OYuQmDOgp/PveDmfybg8c6Mq8RmtqLNqUaZXjwHjO42rnJbV6WcC xSLpusS8B36fFqZaOhN46TD8GBewUFE34nYk2YERFGwuV0JJf3NGoS+vi0kXWYN+yR q6+v7jXVAb2ph65Jf9O5CW5IQv6DyUGRdDgBVt3k7rxSyAsVJlH9wTeKfFoLyecCb9 SFiVHkCUDPQONqNhMFSZTBRo1o2rUjzm5bCj4NruHRMZe1mggMjqNQdLdHbWqxwsqX 1MUDgeHM+KcIA== Date: Wed, 2 Dec 2026 16:44:49 +0000 From: Lee Jones To: Svyatoslav Ryhel Cc: Liam Girdwood , Mark Brown , Rob Herring , Krzysztof Kozlowski , Conor Dooley , linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, mfd@lists.linux.dev Subject: Re: [PATCH v6 2/5] mfd: max8907: Remove platform_data based probing Message-ID: <179568533810.32537.9645200165381940400@kernel.org> References: <20261123150224.199601-1-clamor95@gmail.com> <20261123150224.199601-3-clamor95@gmail.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261123150224.199601-3-clamor95@gmail.com> X-AI-Review-Draft: <20261123150224.199601-3-clamor95@gmail.com> On Mon, 23 Nov 2026, Svyatoslav Ryhel wrote: > There are no in-tree users of this driver, but it supports devicetree > based probing, which means external dtb files may exist that work with > this. > > Remove the unused legacy code and make this a DT-only driver. > > Signed-off-by: Svyatoslav Ryhel > --- > drivers/mfd/max8907.c | 8 +------- > drivers/regulator/max8907-regulator.c | 8 +++----- > include/linux/mfd/max8907.h | 5 ----- > 3 files changed, 4 insertions(+), 17 deletions(-) > > diff --git a/drivers/mfd/max8907.c b/drivers/mfd/max8907.c > index 2f91791410538..a0e0c480ff43e 100644 > --- a/drivers/mfd/max8907.c > +++ b/drivers/mfd/max8907.c > @@ -188,13 +188,7 @@ static int max8907_i2c_probe(struct i2c_client *i2c) > { > struct max8907 *max8907; > int ret; > - struct max8907_platform_data *pdata = dev_get_platdata(&i2c->dev); > - bool pm_off = false; > - > - if (pdata) > - pm_off = pdata->pm_off; > - else if (i2c->dev.of_node) > - pm_off = of_property_read_bool(i2c->dev.of_node, > + bool pm_off = of_property_read_bool(i2c->dev.of_node, > "maxim,system-power-controller"); > > max8907 = devm_kzalloc_obj(&i2c->dev, struct max8907); > diff --git a/drivers/regulator/max8907-regulator.c b/drivers/regulator/max8907-regulator.c > index fd227fd136121..84de0c443c945 100644 > --- a/drivers/regulator/max8907-regulator.c > +++ b/drivers/regulator/max8907-regulator.c > @@ -274,7 +274,6 @@ static inline struct device_node *match_of_node(int index) > static int max8907_regulator_probe(struct platform_device *pdev) > { > struct max8907 *max8907 = dev_get_drvdata(pdev->dev.parent); > - struct max8907_platform_data *pdata = dev_get_platdata(max8907->dev); > int ret; > struct max8907_regulator *pmic; > unsigned int val; > @@ -312,10 +311,9 @@ static int max8907_regulator_probe(struct platform_device *pdev) > struct regulator_dev *rdev; > > config.dev = pdev->dev.parent; > - if (pdata) > - idata = pdata->init_data[i]; > - else > - idata = match_init_data(i); > + > + idata = match_init_data(i); In v3's changelog you noted: "added idata check in max8907_regulator_probe() for BBAT/SDBY/VRTC" ... but that NULL guard around 'idata->supply_regulator' seems to have been dropped here? When a DT omits the 'bbat', 'sdby', or 'vrtc' child node, match_init_data() returns NULL and it will dereference a NULL pointer, no? > config.init_data = idata; > config.driver_data = pmic; > config.regmap = max8907->regmap_gen; > diff --git a/include/linux/mfd/max8907.h b/include/linux/mfd/max8907.h > index 4be3c2370e2a4..e222250f0cc1e 100644 > --- a/include/linux/mfd/max8907.h > +++ b/include/linux/mfd/max8907.h > @@ -227,11 +227,6 @@ enum { > MAX8907_IRQ_RTC_ALARM0, > }; > > -struct max8907_platform_data { > - struct regulator_init_data *init_data[MAX8907_NUM_REGULATORS]; > - bool pm_off; > -}; > - > struct regmap_irq_chips_data; > > struct max8907 { > -- > 2.53.0 > -- Lee Jones