Thread (63 messages) 63 messages, 9 authors, 2022-07-05

Re: [PATCH v5 15/15] reset: elbasr: Add AMD Pensando Elba SR Reset Controller

From: Brad Larson <hidden>
Date: 2022-07-03 22:03:59
Also in: linux-devicetree, linux-mmc, lkml

Hi Philipp,

On Tue, Jun 14, 2022 at 7:49 AM Philipp Zabel [off-list ref] wrote:
Hi Brad,

On Mo, 2022-06-13 at 12:56 -0700, Brad Larson wrote:
quoted
From: Brad Larson <blarson@amd.com>

This patch adds the reset controller functionality for the
AMD Pensando Elba System Resource Chip.

Signed-off-by: Brad Larson <blarson@amd.com>
[...]
quoted
diff --git a/drivers/reset/reset-elbasr.c b/drivers/reset/reset-elbasr.c
...
quoted
+static inline int elbasr_reset_shift(unsigned long id)
+{
+     switch (id) {
+     case EMMC_HW_RESET:
Are there more reset controls than EMMC_HW_RESET?
If so, please list them all.
If not, why is this a function with a switch statement for a single
reset bit?
quoted
+             return 6;
+     default:
+             return -EINVAL;
There are others but only emmc hardware reset is currently needed/used.  Removed
the switch and just using BIT(6) and removed file amd,pensando-elba-reset.h.
The error return value is never checked.
This can't be reached, since ELBASR_NR_RESETS == 1. So id will only
ever be 0.
quoted
+static int elbasr_reset_probe(struct platform_device *pdev)
+{
+     struct elbasr_data *elbasr = dev_get_drvdata(pdev->dev.parent);
Peeking into the MFD driver's private data structure seems unnecessary.
Consider using dev_get_regmap() instead.
Prefer to keep it this way as it follows the approach of existing
driver reset-a10sr.c

Regards,
Brad

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help