From: Dave Penkler <dpenkler@gmail.com>
To: gregkh@linuxfoundation.org, linux-staging@lists.linux.dev,
linux-kernel@vger.kernel.org
Cc: skhan@linuxfoundation.org, arnd@arndb.de,
Dave Penkler <dpenkler@gmail.com>
Subject: [PATCH 5/9] Remove GPIB_DEBUG reference and update messaging
Date: Fri, 1 Nov 2024 18:47:01 +0100 [thread overview]
Message-ID: <20241101174705.12682-6-dpenkler@gmail.com> (raw)
In-Reply-To: <20241101174705.12682-1-dpenkler@gmail.com>
Change pr_alert to dev_alert
Signed-off-by: Dave Penkler <dpenkler@gmail.com>
---
.../gpib/lpvo_usb_gpib/lpvo_usb_gpib.c | 69 +++++++++----------
1 file changed, 34 insertions(+), 35 deletions(-)
diff --git a/drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c b/drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c
index 4c580137043f..796c3a5be545 100644
--- a/drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c
+++ b/drivers/staging/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c
@@ -68,11 +68,8 @@ MODULE_DEVICE_TABLE(usb, skel_table);
* At module loading: modprobe lpvo_usb_gpib debug={0,1,2}
* On the fly: echo {0,1,2} > /sys/modules/lpvo_usb_gpib/parameters/debug
*/
-#ifdef GPIB_DEBUG
-static int debug = 1;
-#else
+
static int debug;
-#endif
module_param(debug, int, 0644);
#define DIA_LOG(level, format, ...) \
@@ -366,10 +363,10 @@ static int one_char(gpib_board_t *board, struct char_buf *b)
DIA_LOG(2, "--> %x\n", b->inbuf[b->last - b->nchar]);
return b->inbuf[b->last - b->nchar--];
} else if (b->nchar == 0) {
- pr_alert("%s:%s - read returned EOF\n", NAME, __func__);
+ dev_alert(board->gpib_dev, "%s:%s - read returned EOF\n", NAME, __func__);
return -EIO;
}
- pr_alert("%s:%s - read error %d\n", NAME, __func__, b->nchar);
+ dev_alert(board->gpib_dev, "%s:%s - read error %d\n", NAME, __func__, b->nchar);
TTY_LOG("\n *** %s *** Read Error - %s\n", NAME,
"Reset the adapter with 'gpib_config'\n");
return -EIO;
@@ -412,8 +409,8 @@ static void set_timeout(gpib_board_t *board)
}
if (val != ACK) {
- pr_alert("%s:%s - error in timeout set: <%s>\n",
- NAME, __func__, command);
+ dev_alert(board->gpib_dev, "%s:%s - error in timeout set: <%s>\n",
+ NAME, __func__, command);
} else {
data->timeout = board->usec_timeout;
}
@@ -456,8 +453,8 @@ static int usb_gpib_attach(gpib_board_t *board, const gpib_board_config_t *confi
if (config->device_path) {
/* if config->device_path given, try that first */
- pr_alert("%s:%s - Looking for device_path: %s\n",
- NAME, __func__, config->device_path);
+ dev_alert(board->gpib_dev, "%s:%s - Looking for device_path: %s\n",
+ NAME, __func__, config->device_path);
for (j = 0 ; j < MAX_DEV ; j++) {
if ((assigned_usb_minors & 1 << j) == 0)
continue;
@@ -492,7 +489,8 @@ static int usb_gpib_attach(gpib_board_t *board, const gpib_board_config_t *confi
mutex_unlock(&minors_lock);
if (j == MAX_DEV) {
- pr_alert("%s:%s - Requested device is not registered.\n", NAME, __func__);
+ dev_alert(board->gpib_dev, "%s:%s - Requested device is not registered.\n",
+ NAME, __func__);
return -EIO;
}
@@ -737,7 +735,8 @@ static int usb_gpib_line_status(const gpib_board_t *board)
buffer = send_command((gpib_board_t *)board, USB_GPIB_STATUS, 0);
if (buffer < 0) {
- pr_alert("%s:%s - line status read failed with %d\n", NAME, __func__, buffer);
+ dev_alert(board->gpib_dev, "%s:%s - line status read failed with %d\n",
+ NAME, __func__, buffer);
return -1;
}
@@ -777,7 +776,7 @@ static int usb_gpib_parallel_poll(gpib_board_t *board, uint8_t *result)
retval = set_control_line(board, IB_BUS_EOI, 1);
if (retval != ACK) {
- pr_alert("%s:%s - assert EOI failed\n", NAME, __func__);
+ dev_alert(board->gpib_dev, "%s:%s - assert EOI failed\n", NAME, __func__);
return -EIO;
}
@@ -787,7 +786,7 @@ static int usb_gpib_parallel_poll(gpib_board_t *board, uint8_t *result)
retval = set_control_line(board, IB_BUS_EOI, 0);
if (retval != 0x06) {
- pr_alert("%s:%s - unassert EOI failed\n", NAME, __func__);
+ dev_alert(board->gpib_dev, "%s:%s - unassert EOI failed\n", NAME, __func__);
return -EIO;
}
@@ -869,8 +868,8 @@ static int usb_gpib_read(gpib_board_t *board,
goto read_return;
if (one_char(board, &b) != DLE || one_char(board, &b) != STX) {
- pr_alert("%s:%s - wrong <DLE><STX> sequence\n",
- NAME, __func__);
+ dev_alert(board->gpib_dev, "%s:%s - wrong <DLE><STX> sequence\n",
+ NAME, __func__);
retval = -EIO;
goto read_return;
}
@@ -910,15 +909,15 @@ static int usb_gpib_read(gpib_board_t *board,
retval = 0;
goto read_return;
} else {
- pr_alert("%s:%s - %s %x\n",
- NAME, __func__,
- "Wrong end of message", c);
+ dev_alert(board->gpib_dev, "%s:%s - %s %x\n",
+ NAME, __func__,
+ "Wrong end of message", c);
retval = -ETIME;
goto read_return;
}
} else {
- pr_alert("%s:%s - %s\n", NAME, __func__,
- "lone <DLE> in stream");
+ dev_alert(board->gpib_dev, "%s:%s - %s\n", NAME, __func__,
+ "lone <DLE> in stream");
retval = -EIO;
goto read_return;
}
@@ -937,8 +936,8 @@ static int usb_gpib_read(gpib_board_t *board,
c = one_char(board, &b);
if (c == ACK) {
if (MAX_READ_EXCESS - read_count > 1)
- pr_alert("%s:%s - %s\n", NAME, __func__,
- "small buffer - maybe some data lost");
+ dev_alert(board->gpib_dev, "%s:%s - %s\n", NAME, __func__,
+ "small buffer - maybe some data lost");
retval = 0;
goto read_return;
}
@@ -946,8 +945,8 @@ static int usb_gpib_read(gpib_board_t *board,
}
}
- pr_alert("%s:%s - no input end - GPIB board in odd state\n",
- NAME, __func__);
+ dev_alert(board->gpib_dev, "%s:%s - no input end - GPIB board in odd state\n",
+ NAME, __func__);
retval = -EIO;
read_return:
@@ -973,8 +972,8 @@ static void usb_gpib_remote_enable(gpib_board_t *board, int enable)
retval = set_control_line(board, IB_BUS_REN, enable ? 1 : 0);
if (retval != ACK)
- pr_alert("%s:%s - could not set REN line: %x\n",
- NAME, __func__, retval);
+ dev_alert(board->gpib_dev, "%s:%s - could not set REN line: %x\n",
+ NAME, __func__, retval);
DIA_LOG(1, "done with %x\n", retval);
}
@@ -1072,21 +1071,21 @@ static int usb_gpib_write(gpib_board_t *board,
static void usb_gpib_parallel_poll_configure(gpib_board_t *board,
uint8_t configuration)
{
- pr_alert("%s:%s - currently a NOP\n", NAME, __func__);
+ dev_alert(board->gpib_dev, "%s:%s - currently a NOP\n", NAME, __func__);
}
/* parallel_poll_response */
static void usb_gpib_parallel_poll_response(gpib_board_t *board, int ist)
{
- pr_alert("%s:%s - currently a NOP\n", NAME, __func__);
+ dev_alert(board->gpib_dev, "%s:%s - currently a NOP\n", NAME, __func__);
}
/* primary_address */
static int usb_gpib_primary_address(gpib_board_t *board, unsigned int address)
{
- pr_alert("%s:%s - currently a NOP\n", NAME, __func__);
+ dev_alert(board->gpib_dev, "%s:%s - currently a NOP\n", NAME, __func__);
return 0;
}
@@ -1094,7 +1093,7 @@ static int usb_gpib_primary_address(gpib_board_t *board, unsigned int address)
static void usb_gpib_return_to_local(gpib_board_t *board)
{
- pr_alert("%s:%s - currently a NOP\n", NAME, __func__);
+ dev_alert(board->gpib_dev, "%s:%s - currently a NOP\n", NAME, __func__);
}
/* secondary_address */
@@ -1103,7 +1102,7 @@ static int usb_gpib_secondary_address(gpib_board_t *board,
unsigned int address,
int enable)
{
- pr_alert("%s:%s - currently a NOP\n", NAME, __func__);
+ dev_alert(board->gpib_dev, "%s:%s - currently a NOP\n", NAME, __func__);
return 0;
}
@@ -1111,14 +1110,14 @@ static int usb_gpib_secondary_address(gpib_board_t *board,
static void usb_gpib_serial_poll_response(gpib_board_t *board, uint8_t status)
{
- pr_alert("%s:%s - currently a NOP\n", NAME, __func__);
+ dev_alert(board->gpib_dev, "%s:%s - currently a NOP\n", NAME, __func__);
}
/* serial_poll_status */
static uint8_t usb_gpib_serial_poll_status(gpib_board_t *board)
{
- pr_alert("%s:%s - currently a NOP\n", NAME, __func__);
+ dev_alert(board->gpib_dev, "%s:%s - currently a NOP\n", NAME, __func__);
return 0;
}
@@ -1126,7 +1125,7 @@ static uint8_t usb_gpib_serial_poll_status(gpib_board_t *board)
static unsigned int usb_gpib_t1_delay(gpib_board_t *board, unsigned int nano_sec)
{
- pr_alert("%s:%s - currently a NOP\n", NAME, __func__);
+ dev_alert(board->gpib_dev, "%s:%s - currently a NOP\n", NAME, __func__);
return 0;
}
--
2.46.2
next prev parent reply other threads:[~2024-11-01 17:47 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-11-01 17:46 [PATCH 0/9] Patch set for gpib staging drivers Dave Penkler
2024-11-01 17:46 ` [PATCH 1/9] Fix buffer overflow in ni_usb_init Dave Penkler
2024-11-01 19:46 ` Dan Carpenter
2024-11-01 17:46 ` [PATCH 2/9] Replace custom debug with dev_dbg Dave Penkler
2024-11-01 17:46 ` [PATCH 3/9] Update messaging and usb_device refs in ni_usb Dave Penkler
2024-11-01 19:48 ` Dan Carpenter
2024-11-01 17:47 ` [PATCH 4/9] Update messaging and usb_device refs in agilent_usb Dave Penkler
2024-11-01 17:47 ` Dave Penkler [this message]
2024-11-01 17:47 ` [PATCH 6/9] Use dev_xxx for messaging Dave Penkler
2024-11-01 17:47 ` [PATCH 7/9] Fix Kconfig Dave Penkler
2024-11-01 19:51 ` Dan Carpenter
2024-11-01 20:03 ` Dan Carpenter
2024-11-01 17:47 ` [PATCH 8/9] Rationalize lookup tables Dave Penkler
2024-11-01 19:55 ` Dan Carpenter
2024-11-01 17:47 ` [PATCH 9/9] Correct check for max secondary address Dave Penkler
2024-11-01 19:59 ` Dan Carpenter
2024-11-02 0:51 ` [PATCH 0/9] Patch set for gpib staging drivers Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20241101174705.12682-6-dpenkler@gmail.com \
--to=dpenkler@gmail.com \
--cc=arnd@arndb.de \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=skhan@linuxfoundation.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.