This patch series splits and improves the previously submitted single patch by
breaking it into four independent, logical changes following kernel submission
etiquette.
Link: https://lore.kernel.org/r/d683962c-e8b7-4adc-9902-483976197637@riscstar.com
Link: https://lore.kernel.org/r/5773d200-1d9d-4d6e-b01e-10d962ee9e8e@quicinc.com
Link: https://lore.kernel.org/r/4f47df18-e98c-4f23-afde-3fa8e9fd0f86@quicinc.com
Link: https://lore.kernel.org/r/202504010829.vIzweYue-lkp@intel.com
Link: https://lore.kernel.org/r/202504011217.iRb2Bbls-lkp@intel.com
All changes are isolated, reviewed, and tested.
Patches included:
1. Replace deprecated strncpy() with strscpy() in firmware.c
2. Replace sprintf() with sysfs_emit() in sysfs show functions
3. Refactor gb_loopback_fn() into smaller helpers
4. Fulfill TODO by splitting get_topology() logic in audio_gb.c
v1 feedback from maintainers highlighted the need to split changes and avoid
unrelated whitespace or formatting edits. These recommendations have been
carefully addressed in this version.
Signed-off-by: Ganesh Kumar Pittala <ganeshkpittala(a)gmail.com>
Ganesh Kumar Pittala (4):
staging: greybus: replace deprecated strncpy with strscpy in
firmware.c
staging: greybus: replace sprintf with sysfs_emit in sysfs show
functions
staging: greybus: refactor gb_loopback_fn into smaller helper
functions
staging: greybus: split gb_audio_gb_get_topology into helper functions
.../greybus/Documentation/firmware/firmware.c | 6 +-
drivers/staging/greybus/arche-apb-ctrl.c | 11 +-
drivers/staging/greybus/arche-platform.c | 11 +-
drivers/staging/greybus/audio_gb.c | 36 +++-
.../staging/greybus/audio_manager_module.c | 13 +-
drivers/staging/greybus/gbphy.c | 3 +-
drivers/staging/greybus/light.c | 5 +-
drivers/staging/greybus/loopback.c | 167 ++++++++++--------
8 files changed, 145 insertions(+), 107 deletions(-)
--
2.43.0
added comments on spinlocks for producer-consumer model, rearranged the
lines on function calls where it should not end with "(" this bracket,
also removed white-spaces and aligned the arguments of function calls.
Signed-off-by: Rujra Bhatt <braker.noob.kernel(a)gmail.com>
>8------------------------------------------------------8<
drivers/greybus/gb-beagleplay.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/drivers/greybus/gb-beagleplay.c b/drivers/greybus/gb-beagleplay.c
index 473ac3f2d382..fa1c3a40dd0b 100644
--- a/drivers/greybus/gb-beagleplay.c
+++ b/drivers/greybus/gb-beagleplay.c
@@ -73,7 +73,9 @@ struct gb_beagleplay {
struct gb_host_device *gb_hd;
struct work_struct tx_work;
+ //used to ensure that only one producer can access the shared
resource at a time.
spinlock_t tx_producer_lock;
+ //used to ensure that only one consumer can access the shared
resource at a time.
spinlock_t tx_consumer_lock;
struct circ_buf tx_circ_buf;
u16 tx_crc;
@@ -642,8 +644,8 @@ static int cc1352_bootloader_wait_for_ack(struct
gb_beagleplay *bg)
{
int ret;
- ret = wait_for_completion_timeout(
- &bg->fwl_ack_com, msecs_to_jiffies(CC1352_BOOTLOADER_TIMEOUT));
+ ret = wait_for_completion_timeout(&bg->fwl_ack_com,
+
msecs_to_jiffies(CC1352_BOOTLOADER_TIMEOUT));
if (ret < 0)
return dev_err_probe(&bg->sd->dev, ret,
"Failed to acquire ack semaphore");
@@ -680,9 +682,8 @@ static int cc1352_bootloader_get_status(struct
gb_beagleplay *bg)
if (ret < 0)
return ret;
- ret = wait_for_completion_timeout(
- &bg->fwl_cmd_response_com,
- msecs_to_jiffies(CC1352_BOOTLOADER_TIMEOUT));
+ ret = wait_for_completion_timeout(&bg->fwl_cmd_response_com,
+
msecs_to_jiffies(CC1352_BOOTLOADER_TIMEOUT));
if (ret < 0)
return dev_err_probe(&bg->sd->dev, ret,
"Failed to acquire last status semaphore");
@@ -765,9 +766,8 @@ static int cc1352_bootloader_crc32(struct
gb_beagleplay *bg, u32 *crc32)
if (ret < 0)
return ret;
- ret = wait_for_completion_timeout(
- &bg->fwl_cmd_response_com,
- msecs_to_jiffies(CC1352_BOOTLOADER_TIMEOUT));
+ ret = wait_for_completion_timeout(&bg->fwl_cmd_response_com,
+
msecs_to_jiffies(CC1352_BOOTLOADER_TIMEOUT));
if (ret < 0)
return dev_err_probe(&bg->sd->dev, ret,
"Failed to acquire last status semaphore");
--
2.43.0