staging-next: most: dim2: convert pr_info/err/warn to dev_info/err/warn
Subsystems (2)
PATCH 1/1 staging-next: most: dim2: convert pr_info/err/warn to dev_info/err/warn
Note: This is a re-submission of a previous patch sent with an incorrect CC. Please consider this the correct submission.
The dim2 driver currently uses generic pr_* logging macros. Hardware drivers should use the device-specific dev_* logging macros to provide better context in the system logs, especially in systems with multiple controller instances.
This patch converts all applicable logging calls in dim2.c to use the proper device-specific APIs.
Note: This patch is rebased on the current staging-next branch. It was previously submitted against master.
--- drivers/staging/most/dim2/dim2.c | 44 ++++++++++++++++---------------- 1 file changed, 22 insertions(+), 22 deletions(-)
drivers/staging/most/dim2/dim2.c +22 -22
@@ -246,9 +246,9 @@ static void retrieve_netinfo(struct dim2_hdm *dev, struct mbo *mbo) {u8 *data = mbo->virt_address; -pr_info ("Node Address: 0x%03x\n" , (u16 )data[16 ] <<8 | data[17 ]); +dev_info (&dev->dev,"Node Address: 0x%03x\n" , (u16 )data[16 ] <<8 | data[17 ]); dev->link_state = data[18 ]; -pr_info ("NIState: %d\n" , dev->link_state); +dev_info (&dev->dev,"NIState: %d\n" , dev->link_state);memcpy (dev->mac_addrs, data +19 ,6 ); dev->deliver_netinfo++;wake_up_interruptible (&dev->netinfo_waitq);
@@ -472,13 +472,13 @@ static int configure_channel(struct most_interface *most_iface, int ch_idx,case MOST_CH_CONTROL : new_size =dim_norm_ctrl_async_buffer_size (buf_size);if (new_size ==0 ) { -pr_err ("%s: too small buffer size\n" , hdm_ch->name); +dev_err (&dev->dev,"%s: too small buffer size\n" , hdm_ch->name);return -EINVAL ; } ccfg->buffer_size = new_size;if (new_size != buf_size) -pr_warn ("%s: fixed buffer size (%d -> %d)\n" , - hdm_ch->name, buf_size, new_size); +dev_warn (&dev->dev,"%s: fixed buffer size (%d -> %d)\n" , + hdm_ch->name, buf_size, new_size);spin_lock_irqsave (&dim_lock, flags); hal_ret =dim_init_control (&hdm_ch->ch, is_tx, ch_addr, is_tx ? new_size *2 : new_size);
@@ -486,13 +486,13 @@ static int configure_channel(struct most_interface *most_iface, int ch_idx,case MOST_CH_ASYNC : new_size =dim_norm_ctrl_async_buffer_size (buf_size);if (new_size ==0 ) { -pr_err ("%s: too small buffer size\n" , hdm_ch->name); +dev_err (&dev->dev,"%s: too small buffer size\n" , hdm_ch->name);return -EINVAL ; } ccfg->buffer_size = new_size;if (new_size != buf_size) -pr_warn ("%s: fixed buffer size (%d -> %d)\n" , - hdm_ch->name, buf_size, new_size); +dev_warn (&dev->dev,"%s: fixed buffer size (%d -> %d)\n" , + hdm_ch->name, buf_size, new_size);spin_lock_irqsave (&dim_lock, flags); hal_ret =dim_init_async (&hdm_ch->ch, is_tx, ch_addr, is_tx ? new_size *2 : new_size);
@@ -500,41 +500,41 @@ static int configure_channel(struct most_interface *most_iface, int ch_idx,case MOST_CH_ISOC : new_size =dim_norm_isoc_buffer_size (buf_size, sub_size);if (new_size ==0 ) { -pr_err ("%s: invalid sub-buffer size or too small buffer size\n" , - hdm_ch->name); +dev_err (&dev->dev,"%s: invalid sub-buffer size or too small buffer size\n" , + hdm_ch->name);return -EINVAL ; } ccfg->buffer_size = new_size;if (new_size != buf_size) -pr_warn ("%s: fixed buffer size (%d -> %d)\n" , - hdm_ch->name, buf_size, new_size); +dev_warn (&dev->dev,"%s: fixed buffer size (%d -> %d)\n" , + hdm_ch->name, buf_size, new_size);spin_lock_irqsave (&dim_lock, flags); hal_ret =dim_init_isoc (&hdm_ch->ch, is_tx, ch_addr, sub_size);break ;case MOST_CH_SYNC : new_size =dim_norm_sync_buffer_size (buf_size, sub_size);if (new_size ==0 ) { -pr_err ("%s: invalid sub-buffer size or too small buffer size\n" , - hdm_ch->name); +dev_err (&dev->dev,"%s: invalid sub-buffer size or too small buffer size\n" , + hdm_ch->name);return -EINVAL ; } ccfg->buffer_size = new_size;if (new_size != buf_size) -pr_warn ("%s: fixed buffer size (%d -> %d)\n" , - hdm_ch->name, buf_size, new_size); +dev_warn (&dev->dev,"%s: fixed buffer size (%d -> %d)\n" , + hdm_ch->name, buf_size, new_size);spin_lock_irqsave (&dim_lock, flags); hal_ret =dim_init_sync (&hdm_ch->ch, is_tx, ch_addr, sub_size);break ;default : -pr_err ("%s: configure failed, bad channel type: %d\n" , - hdm_ch->name, ccfg->data_type); +dev_err (&dev->dev,"%s: configure failed, bad channel type: %d\n" , + hdm_ch->name, ccfg->data_type);return -EINVAL ; }if (hal_ret !=DIM_NO_ERROR ) {spin_unlock_irqrestore (&dim_lock, flags); -pr_err ("%s: configure failed (%d), type: %d, is_tx: %d\n" , - hdm_ch->name, hal_ret, ccfg->data_type, (int )is_tx); +dev_err (&dev->dev,"%s: configure failed (%d), type: %d, is_tx: %d\n" , + hdm_ch->name, hal_ret, ccfg->data_type, (int )is_tx);return -ENODEV ; }
@@ -608,7 +608,7 @@ static void request_netinfo(struct most_interface *most_iface, int ch_idx,return ;if (dev->atx_idx <0 ) { -pr_err ("Async Tx Not initialized\n" ); +dev_err (&dev->dev,"Async Tx Not initialized\n" );return ; }
@@ -657,7 +657,7 @@ static int poison_channel(struct most_interface *most_iface, int ch_idx) dev->atx_idx =-1 ;spin_unlock_irqrestore (&dim_lock, flags);if (hal_ret !=DIM_NO_ERROR ) { -pr_err ("HAL Failed to close channel %s\n" , hdm_ch->name); +dev_err (&dev->dev,"HAL Failed to close channel %s\n" , hdm_ch->name); ret = -EFAULT ; }
Signature · 1 line
2.43.0
Quoted 2 lines · Zeeshan Ahmad
Note: This is a re-submission of a previous patch sent with an incorrect CC. Please consider this the correct submission.
This line is over 75 characters which breaks linux kernel coding style. Use "$ ./scripts/checkpatch.pl --strict <patch>" from now on before sending your patch off to catch things like this. Also, this note belongs in your v2 changes below the "---".
Quoted 11 lines
The dim2 driver currently uses generic pr_* logging macros. Hardware drivers should use the device-specific dev_* logging macros to provide better context in the system logs, especially in systems with multiple controller instances.
This patch converts all applicable logging calls in
dim2.cto use the proper device-specific APIs.Note: This patch is rebased on the current staging-next branch. It was previously submitted against master.
This should also be below the "---" in v2 changes.
Quoted 3 lines
Signed-off-by Zeeshan Ahmad <[email protected]>---
Your header begins with "[PATCH] [PATCH]" [PATCH] should only happen once and since it appears this is your v2 it should have been [PATCH v2]. Also, you used "staging-next:" I guess you were using the branch name but, the correct way to do it is just "staging:".
Please visit Dan Carpenter's guide on submitting a v2: (but this next one will be your v3)
https://staticthinking.wordpress.com/2022/07/27/how-to-send-a-v2-patch/
Thanks,
ET