Message ID | e2f2c5c6995a011494105484849776a856af5bcc.1635533924.git.philipp.g.hortmann@gmail.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | Docs: usb: Example code updates from usb-skeleton | expand |
On 10/29/21 10:39 PM, Philipp Hortmann wrote: > update err() to pr_err() and replace __FILE__ > > Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> > --- > Documentation/driver-api/usb/writing_usb_driver.rst | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/Documentation/driver-api/usb/writing_usb_driver.rst b/Documentation/driver-api/usb/writing_usb_driver.rst > index 2176297e5765..5c29e5bdbe88 100644 > --- a/Documentation/driver-api/usb/writing_usb_driver.rst > +++ b/Documentation/driver-api/usb/writing_usb_driver.rst > @@ -91,8 +91,8 @@ usually in the driver's init function, as shown here:: > /* register this driver with the USB subsystem */ > result = usb_register(&skel_driver); > if (result < 0) { > - err("usb_register failed for the "__FILE__ "driver." > - "Error number %d", result); > + pr_err("usb_register failed for the %s driver. " Don't break up the kernel message like this. The current code is a bad example -- high time to fix it. :-) > + "Error number %d", skel_driver.name, result); > return -1; > } > MBR, Sergey
On 29.10.2021 23:33, Sergey Shtylyov wrote: [...] >> update err() to pr_err() and replace __FILE__ >> >> Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> >> --- >> Documentation/driver-api/usb/writing_usb_driver.rst | 4 ++-- >> 1 file changed, 2 insertions(+), 2 deletions(-) >> >> diff --git a/Documentation/driver-api/usb/writing_usb_driver.rst b/Documentation/driver-api/usb/writing_usb_driver.rst >> index 2176297e5765..5c29e5bdbe88 100644 >> --- a/Documentation/driver-api/usb/writing_usb_driver.rst >> +++ b/Documentation/driver-api/usb/writing_usb_driver.rst >> @@ -91,8 +91,8 @@ usually in the driver's init function, as shown here:: >> /* register this driver with the USB subsystem */ >> result = usb_register(&skel_driver); >> if (result < 0) { >> - err("usb_register failed for the "__FILE__ "driver." >> - "Error number %d", result); >> + pr_err("usb_register failed for the %s driver. " > > Don't break up the kernel message like this. The current code is a bad example -- > high time to fix it. :-) > >> + "Error number %d", skel_driver.name, result); Oh, and add `\n' at the end of message. [...] MBR, Sergey
diff --git a/Documentation/driver-api/usb/writing_usb_driver.rst b/Documentation/driver-api/usb/writing_usb_driver.rst index 2176297e5765..5c29e5bdbe88 100644 --- a/Documentation/driver-api/usb/writing_usb_driver.rst +++ b/Documentation/driver-api/usb/writing_usb_driver.rst @@ -91,8 +91,8 @@ usually in the driver's init function, as shown here:: /* register this driver with the USB subsystem */ result = usb_register(&skel_driver); if (result < 0) { - err("usb_register failed for the "__FILE__ "driver." - "Error number %d", result); + pr_err("usb_register failed for the %s driver. " + "Error number %d", skel_driver.name, result); return -1; }
update err() to pr_err() and replace __FILE__ Signed-off-by: Philipp Hortmann <philipp.g.hortmann@gmail.com> --- Documentation/driver-api/usb/writing_usb_driver.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)