Re: [PATCH -next 8/8] soc: ti: knav_qmss_queue: Simplify with scoped for each OF child loop

2024-08-29 Thread Nishanth Menon
On 21:28-20240829, Kousik Sanagavarapu wrote:
> Jinjie Ruan  writes:
> > @@ -1080,17 +1080,13 @@ static int knav_queue_setup_regions(struct 
> > knav_device *kdev,
> >  {
> > struct device *dev = kdev->dev;
> > struct knav_region *region;
> > -   struct device_node *child;
> > u32 temp[2];
> > int ret;
> >  
> > -   for_each_child_of_node(regions, child) {
> > +   for_each_child_of_node_scoped(regions, child) {
> 
> Are you sure using *_scoped() is better here?  Since it seems that we
> need the memory pointed to by "child" in cases where we don't go into an
> error path.
> 
> > region = devm_kzalloc(dev, sizeof(*region), GFP_KERNEL);
> > -   if (!region) {
> > -   of_node_put(child);
> > -   dev_err(dev, "out of memory allocating region\n");
> > -   return -ENOMEM;
> > -   }
> > +   if (!region)
> > +   return dev_err_probe(dev, -ENOMEM, "out of memory 
> > allocating region\n");
> >  
> > region->name = knav_queue_find_name(child);
> > of_property_read_u32(child, "id", ®ion->id);
> 
> Similarly in most of the other cases in this series where a similar
> change is done.
> 
> Also FYI, as for dev_err_probe(), I think I covered all of them in this
> file and a patch for it is currently sitting in ti-drivers-soc-next.
> 

Thanks Kousik. yeah - it will probably help with a rebase to latest
next.

-- 
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 
849D 1736 249D



Re: (subset) [PATCH 00/40] soc: Convert to platform remove callback returning void

2023-10-02 Thread Nishanth Menon
Hi Uwe Kleine-König,

On Mon, 25 Sep 2023 11:54:51 +0200, Uwe Kleine-König wrote:
> this series converts all platform drivers below drivers/soc to use
> .remove_new(). The motivation is to get rid of an integer return code
> that is (mostly) ignored by the platform driver core and error prone on
> the driver side.
> 
> See commit 5c5a7680e67b ("platform: Provide a remove callback that
> returns no value") for an extended explanation and the eventual goal.
> 
> [...]

I have applied the following to branch ti-drivers-soc-next on [1].
Thank you!

[33/40] soc/ti: k3-ringacc: Convert to platform remove callback returning void
commit: f34b902c5ba67841902cd7f0e24e64bb82f69cb4
[34/40] soc/ti: knav_dma: Convert to platform remove callback returning void
commit: 3af4ec7c7dd39a2c4618f6536b2e7b73a19be169
[35/40] soc/ti: knav_qmss_queue: Convert to platform remove callback returning 
void
commit: af97160a0c5f1908c6f2830023fb93baac4451d3
[36/40] soc/ti: pm33xx: Convert to platform remove callback returning void
commit: 9eb950e9fffc5337bfe1798cf89ce4d97a4f1221
[37/40] soc/ti: pruss: Convert to platform remove callback returning void
commit: d183b20d340b7c098f44cb5c02f4ced01cfd0b16
[38/40] soc/ti: smartreflex: Convert to platform remove callback returning void
commit: ba03aab9bfb4c9d456419da3891375d45c6bfe15
[39/40] soc/ti: wkup_m3_ipc: Convert to platform remove callback returning void
commit: 82e83cb51c87b5bf3ab83f7c7b150c19400056c2

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent up the chain during
the next merge window (or sooner if it is a relevant bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

[1] https://git.kernel.org/pub/scm/linux/kernel/git/ti/linux.git
-- 
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 
849D 1736 249D



[PATCH] tty: hvc_dcc: Add basic early_con support

2016-12-19 Thread Nishanth Menon
In some cases, earlycon can help catch errors with kernel boot prior to
standard console is available.

Example bootargs: console=hvc0 earlycon=hvcdcc

Signed-off-by: Nishanth Menon 
---
Based on: v4.9 tag
Also applies on: next-20161219
Tested on Simulation environment (which did not have serial console option)

 drivers/tty/hvc/hvc_dcc.c | 44 
 1 file changed, 44 insertions(+)

diff --git a/drivers/tty/hvc/hvc_dcc.c b/drivers/tty/hvc/hvc_dcc.c
index 82f240fb98f0..1ec06e550656 100644
--- a/drivers/tty/hvc/hvc_dcc.c
+++ b/drivers/tty/hvc/hvc_dcc.c
@@ -10,7 +10,9 @@
  * GNU General Public License for more details.
  */
 
+#include 
 #include 
+#include 
 
 #include 
 #include 
@@ -94,3 +96,45 @@ static int __init hvc_dcc_init(void)
return PTR_ERR_OR_ZERO(p);
 }
 device_initcall(hvc_dcc_init);
+
+static int hvc_dcc_earlyputc(int c)
+{
+   unsigned long count = 0x;
+   static bool dead_dcc_earlycon;
+
+   if (dead_dcc_earlycon)
+   return -EBUSY;
+
+   while (count--) {
+   if (!(__dcc_getstatus() & DCC_STATUS_TX))
+   break;
+   }
+   if (!count) {
+   dead_dcc_earlycon = true;
+   return -EBUSY;
+   }
+   __dcc_putchar(c);
+   return 0;
+}
+
+static void hvc_dcc_earlywrite(struct console *con, const char *s,
+  unsigned int n)
+{
+   int r;
+
+   while (n--) {
+   r = hvc_dcc_earlyputc(*s);
+   if (r)
+   break;
+   s++;
+   }
+}
+
+static int
+__init early_hvc_dcc_setup(struct earlycon_device *device, const char *opt)
+{
+   device->con->write = hvc_dcc_earlywrite;
+   return 0;
+}
+
+EARLYCON_DECLARE(hvcdcc, early_hvc_dcc_setup);
-- 
2.11.0.65.geff96d7