Check the return values of send_control() and send_line_coding() during
device initialization in gb_uart_probe(). If these operations fail, the
device will be left in an inconsistent state, so propagate the error to
properly fail the probe.
Both functions call gb_operation_sync() which can fail with errors such
as -ENOMEM, -ENODEV, or -ETIMEDOUT. Ignoring these errors means the TTY
device would be registered despite incomplete initialization.
Signed-off-by: Nirbhay Sharma <nirbhay.lkd(a)gmail.com>
---
drivers/staging/greybus/uart.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/greybus/uart.c b/drivers/staging/greybus/uart.c
index 10df5c37c83e..5cece0a6606f 100644
--- a/drivers/staging/greybus/uart.c
+++ b/drivers/staging/greybus/uart.c
@@ -879,14 +879,18 @@ static int gb_uart_probe(struct gbphy_device *gbphy_dev,
if (retval)
goto exit_put_port;
- send_control(gb_tty, gb_tty->ctrlout);
+ retval = send_control(gb_tty, gb_tty->ctrlout);
+ if (retval)
+ goto exit_connection_disable;
/* initialize the uart to be 9600n81 */
gb_tty->line_coding.rate = cpu_to_le32(9600);
gb_tty->line_coding.format = GB_SERIAL_1_STOP_BITS;
gb_tty->line_coding.parity = GB_SERIAL_NO_PARITY;
gb_tty->line_coding.data_bits = 8;
- send_line_coding(gb_tty);
+ retval = send_line_coding(gb_tty);
+ if (retval)
+ goto exit_connection_disable;
retval = gb_connection_enable(connection);
if (retval)
--
2.48.1
On Thu, Nov 13, 2025 at 10:12:00PM +0800, Chang Junzheng wrote:
> From: Chang Junzheng <guagua210311(a)outlook.com>
>
> Fix checkpatch.pl warning by changing envp array declaration to
> static const char * const. This improves code safety and follows
> kernel coding style recommendations.
>
> Signed-off-by: Chang Junzheng <guagua210311(a)qq.com>
> Changes in v2:
> - Restored original indentation of array elements
> - Only changed the array declaration as originally intended
The "Changes" goes below the --- line, as per the documentation.
thanks,
greg k-h
On Thu, Nov 13, 2025 at 09:39:54PM +0800, cjz_VM wrote:
> Hi Greg,
>
> Thanks for reviewing my patch!
>
> For sending twice: I apologize for the duplicate. After the first send, I realized I had missed some greybus-specific maintainers, so I resent to include them all.
Then that should have been a v2 patch :)
> For the indentation: You're right to ask about it. When I changed the declaration from 'char *envp[]' to 'static const char * const envp[]', the opening bracket moved to the right due to the longer declaration. I added tabs to keep the array elements aligned with the opening bracket, following the kernel coding style rule that parameters should align with the opening parenthesis.
>
> If this alignment approach is not preferred, I'm happy to adjust it to whatever style you recommend.
You did not document your change, and it had nothing really to do with
the const change, so I would not recommend doing this.
Also, please do not top-post, and be sure to properly wrap your lines in
your email client.
thanks,
greg k-h
This continues the effort to refactor workqueue APIs, which began with
the introduction of new workqueues and a new alloc_workqueue flag in:
commit 128ea9f6ccfb ("workqueue: Add system_percpu_wq and system_dfl_wq")
commit 930c2ea566af ("workqueue: Add new WQ_PERCPU flag")
This change adds a new WQ_PERCPU flag to explicitly request
alloc_workqueue() to be per-cpu when WQ_UNBOUND has not been specified.
With the introduction of the WQ_PERCPU flag (equivalent to !WQ_UNBOUND),
any alloc_workqueue() caller that doesn’t explicitly specify WQ_UNBOUND
must now use WQ_PERCPU.
Once migration is complete, WQ_UNBOUND can be removed and unbound will
become the implicit default.
Suggested-by: Tejun Heo <tj(a)kernel.org>
Signed-off-by: Marco Crivellari <marco.crivellari(a)suse.com>
Reviewed-by: Johan Hovold <johan(a)kernel.org>
---
Changes in v2:
- updated commit log removing two paragraph not strictly related to
the work.
- subject changed removing "drivers/" before the actual prefix.
---
drivers/greybus/operation.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/greybus/operation.c b/drivers/greybus/operation.c
index 54ccc434a1f7..7e12ffb2dd60 100644
--- a/drivers/greybus/operation.c
+++ b/drivers/greybus/operation.c
@@ -1238,7 +1238,7 @@ int __init gb_operation_init(void)
goto err_destroy_message_cache;
gb_operation_completion_wq = alloc_workqueue("greybus_completion",
- 0, 0);
+ WQ_PERCPU, 0);
if (!gb_operation_completion_wq)
goto err_destroy_operation_cache;
--
2.51.1