Re: [PATCH V5 15/17] regulator: Regulator driver for the Mediatek DVFSRC

From
Mark Brown <broonie@kernel.org>
Date
2020-09-14 12:40:24
Also in
linux-devicetree, linux-mediatek, linux-pm, lkml
Reply to
Henry Chen, 2020-09-14
On Mon, Sep 14, 2020 at 11:04:42AM +0800, Henry Chen wrote:
quoted hunk ↗ jump to hunk
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2019 MediaTek Inc.
+ */
Please make the entire comment a C++ one so things look more
intentional, and are you sure about that copyright date?
quoted hunk ↗ jump to hunk
+static int dvfsrc_set_voltage_sel(struct regulator_dev *rdev,
+				  unsigned int selector)
+{
+	struct device *dvfsrc_dev = to_dvfsrc_dev(rdev);
+	int id = rdev_get_id(rdev);
+
+	switch (id) {
+	case DVFSRC_ID_VCORE:
+		mtk_dvfsrc_send_request(dvfsrc_dev,
+					MTK_DVFSRC_CMD_VCORE_REQUEST,
+					selector);
+	break;
+	case DVFSRC_ID_VSCP:
+		mtk_dvfsrc_send_request(dvfsrc_dev,
+					MTK_DVFSRC_CMD_VSCP_REQUEST,
+					selector);
+	break;
Just have two separate operations rather than the switch statement, and
where you do have switch statements please follow the kernel coding
style.
Thread (23 messages) 23 messages, 3 authors, last reply 2020-09-22
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help