lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250723-adamant-smiling-markhor-a8ebee@kuoka>
Date: Wed, 23 Jul 2025 09:47:56 +0200
From: Krzysztof Kozlowski <krzk@...nel.org>
To: muhammed.efecetin.67@...il.com
Cc: linux-rockchip@...ts.infradead.org, devicetree@...r.kernel.org, 
	linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org, robh+dt@...nel.org, 
	krzysztof.kozlowski+dt@...aro.org, heiko@...ech.de, neil.armstrong@...aro.org, lee@...nel.org, 
	rafael@...nel.org, efectn@...tonmail.com, daniel.lezcano@...aro.org
Subject: Re: [PATCH v2 3/5] mfd: add Khadas Edge 2 registers to khadas-mcu.

On Tue, Jul 22, 2025 at 03:38:13PM +0300, muhammed.efecetin.67@...il.com wrote:
>  	ddata = devm_kzalloc(dev, sizeof(*ddata), GFP_KERNEL);
> @@ -94,7 +130,11 @@ static int khadas_mcu_probe(struct i2c_client *client)
>  
>  	ddata->dev = dev;
>  
> -	ddata->regmap = devm_regmap_init_i2c(client, &khadas_mcu_regmap_config);
> +	if (of_device_is_compatible(dev->of_node, "khadas,mcu-v2"))

This does not scale. Use device match data for exactly this purpose.

> +		regmap_config = &khadas_mcu_regmap_config_v2;
> +	else
> +		regmap_config = &khadas_mcu_regmap_config;
> +	ddata->regmap = devm_regmap_init_i2c(client, regmap_config);
>  	if (IS_ERR(ddata->regmap)) {
>  		ret = PTR_ERR(ddata->regmap);
>  		dev_err(dev, "Failed to allocate register map: %d\n", ret);
> @@ -113,6 +153,7 @@ static int khadas_mcu_probe(struct i2c_client *client)
>  #ifdef CONFIG_OF
>  static const struct of_device_id khadas_mcu_of_match[] = {
>  	{ .compatible = "khadas,mcu", },
> +	{ .compatible = "khadas,mcu-v2", },

So devices are 100% compatible? Empty match data suggests that...

Best regards,
Krzysztof


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ