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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251230-congenial-vagabond-cicada-d6b8fe@quoll>
Date: Tue, 30 Dec 2025 13:17:36 +0100
From: Krzysztof Kozlowski <krzk@...nel.org>
To: Yu-Chun Lin <eleanor.lin@...ltek.com>
Cc: mturquette@...libre.com, sboyd@...nel.org, robh@...nel.org, 
	krzk+dt@...nel.org, conor+dt@...nel.org, p.zabel@...gutronix.de, cylee12@...ltek.com, 
	jyanchou@...ltek.com, devicetree@...r.kernel.org, linux-clk@...r.kernel.org, 
	linux-kernel@...r.kernel.org, james.tai@...ltek.com, cy.huang@...ltek.com, 
	stanley_chang@...ltek.com
Subject: Re: [PATCH 3/9] clk: realtek: Introduce a common probe()

On Mon, Dec 29, 2025 at 03:53:07PM +0800, Yu-Chun Lin wrote:
> Add rtk_clk_probe() to set up the shared regmap, register clock hardware,
> add the clock provider, and optionally register a reset controller when
> reset bank data is provided.
> 
> Signed-off-by: Cheng-Yu Lee <cylee12@...ltek.com>
> Signed-off-by: Yu-Chun Lin <eleanor.lin@...ltek.com>
> ---
>  drivers/clk/realtek/Makefile |  1 +
>  drivers/clk/realtek/common.c | 72 ++++++++++++++++++++++++++++++++++++
>  drivers/clk/realtek/common.h | 40 ++++++++++++++++++++
>  3 files changed, 113 insertions(+)
>  create mode 100644 drivers/clk/realtek/common.c
>  create mode 100644 drivers/clk/realtek/common.h
> 
> diff --git a/drivers/clk/realtek/Makefile b/drivers/clk/realtek/Makefile
> index 52267de2eef4..4041951b7c62 100644
> --- a/drivers/clk/realtek/Makefile
> +++ b/drivers/clk/realtek/Makefile
> @@ -1,4 +1,5 @@
>  # SPDX-License-Identifier: GPL-2.0-only
>  obj-$(CONFIG_RTK_CLK_COMMON) += clk-rtk.o
>  
> +clk-rtk-y += common.o
>  clk-rtk-y += reset.o
> diff --git a/drivers/clk/realtek/common.c b/drivers/clk/realtek/common.c
> new file mode 100644
> index 000000000000..df89d2a10291
> --- /dev/null
> +++ b/drivers/clk/realtek/common.c
> @@ -0,0 +1,72 @@
> +// SPDX-License-Identifier: GPL-2.0-only
> +/*
> + * Copyright (C) 2019 Realtek Semiconductor Corporation
> + * Author: Cheng-Yu Lee <cylee12@...ltek.com>
> + */
> +
> +#include <linux/device.h>
> +#include <linux/module.h>
> +#include <linux/mfd/syscon.h>
> +#include <linux/platform_device.h>
> +#include "common.h"
> +
> +int rtk_clk_probe(struct platform_device *pdev, const struct rtk_clk_desc *desc)
> +{
> +	int i, ret;
> +	struct device *dev = &pdev->dev;
> +	struct rtk_reset_initdata reset_initdata = { 0 };
> +

There is never blank line between declarations.

> +	struct regmap *regmap = device_node_to_regmap(pdev->dev.of_node);

This is not supposed to be declaration with initialization.

> +

There is never blank line between get and if().

> +	if (IS_ERR(regmap)) {
> +		ret = PTR_ERR(regmap);
> +		dev_err(dev, "Failed to get regmap: %d\n", ret);
> +		return ret;

Syntax is just return dev_err_probe. Don't send us 2022 code, but
completely rework this to match upstream style.

> +	}
> +
> +	for (i = 0; i < desc->num_clks; i++)
> +		desc->clks[i]->regmap = regmap;
> +
> +	for (i = 0; i < desc->clk_data->num; i++) {
> +		struct clk_hw *hw = desc->clk_data->hws[i];
> +
> +		if (!hw)
> +			continue;
> +
> +		ret = devm_clk_hw_register(dev, hw);
> +
> +		if (ret) {
> +			dev_warn(dev, "failed to register hw of clk%d: %d\n", i,
> +				 ret);
> +			desc->clk_data->hws[i] = NULL;
> +		}
> +	}
> +
> +	ret = devm_of_clk_add_hw_provider(dev, of_clk_hw_onecell_get,
> +					  desc->clk_data);
> +
> +	if (ret) {
> +		dev_err(dev, "Failed to add clock provider\n");

Really... 2022 code...

Best regards,
Krzysztof


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ