Commit 62573221 authored by Christian Gromm's avatar Christian Gromm Committed by Greg Kroah-Hartman

staging: most: usb: use dev_*() functions to print messages

This patch removes the pr_*() functions and uses dev_*() instead.
Signed-off-by: default avatarChristian Gromm <christian.gromm@microchip.com>
Reported-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/1589534465-7423-2-git-send-email-christian.gromm@microchip.comSigned-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8a01032e
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
* Copyright (C) 2013-2015 Microchip Technology Germany II GmbH & Co. KG * Copyright (C) 2013-2015 Microchip Technology Germany II GmbH & Co. KG
*/ */
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
#include <linux/module.h> #include <linux/module.h>
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/usb.h> #include <linux/usb.h>
...@@ -186,13 +185,14 @@ static inline int start_sync_ep(struct usb_device *usb_dev, u16 ep) ...@@ -186,13 +185,14 @@ static inline int start_sync_ep(struct usb_device *usb_dev, u16 ep)
* get_stream_frame_size - calculate frame size of current configuration * get_stream_frame_size - calculate frame size of current configuration
* @cfg: channel configuration * @cfg: channel configuration
*/ */
static unsigned int get_stream_frame_size(struct most_channel_config *cfg) static unsigned int get_stream_frame_size(struct most_channel_config *cfg,
struct device *dev)
{ {
unsigned int frame_size = 0; unsigned int frame_size = 0;
unsigned int sub_size = cfg->subbuffer_size; unsigned int sub_size = cfg->subbuffer_size;
if (!sub_size) { if (!sub_size) {
pr_warn("Misconfig: Subbuffer size zero.\n"); dev_warn(dev, "Misconfig: Subbuffer size zero.\n");
return frame_size; return frame_size;
} }
switch (cfg->data_type) { switch (cfg->data_type) {
...@@ -201,7 +201,7 @@ static unsigned int get_stream_frame_size(struct most_channel_config *cfg) ...@@ -201,7 +201,7 @@ static unsigned int get_stream_frame_size(struct most_channel_config *cfg)
break; break;
case MOST_CH_SYNC: case MOST_CH_SYNC:
if (cfg->packets_per_xact == 0) { if (cfg->packets_per_xact == 0) {
pr_warn("Misconfig: Packets per XACT zero\n"); dev_warn(dev, "Misconfig: Packets per XACT zero\n");
frame_size = 0; frame_size = 0;
} else if (cfg->packets_per_xact == 0xFF) { } else if (cfg->packets_per_xact == 0xFF) {
frame_size = (USB_MTU / sub_size) * sub_size; frame_size = (USB_MTU / sub_size) * sub_size;
...@@ -210,7 +210,7 @@ static unsigned int get_stream_frame_size(struct most_channel_config *cfg) ...@@ -210,7 +210,7 @@ static unsigned int get_stream_frame_size(struct most_channel_config *cfg)
} }
break; break;
default: default:
pr_warn("Query frame size of non-streaming channel\n"); dev_warn(dev, "Query frame size of non-streaming channel\n");
break; break;
} }
return frame_size; return frame_size;
...@@ -270,7 +270,7 @@ static int hdm_poison_channel(struct most_interface *iface, int channel) ...@@ -270,7 +270,7 @@ static int hdm_poison_channel(struct most_interface *iface, int channel)
static int hdm_add_padding(struct most_dev *mdev, int channel, struct mbo *mbo) static int hdm_add_padding(struct most_dev *mdev, int channel, struct mbo *mbo)
{ {
struct most_channel_config *conf = &mdev->conf[channel]; struct most_channel_config *conf = &mdev->conf[channel];
unsigned int frame_size = get_stream_frame_size(conf); unsigned int frame_size = get_stream_frame_size(conf, &mdev->dev);
unsigned int j, num_frames; unsigned int j, num_frames;
if (!frame_size) if (!frame_size)
...@@ -304,7 +304,7 @@ static int hdm_remove_padding(struct most_dev *mdev, int channel, ...@@ -304,7 +304,7 @@ static int hdm_remove_padding(struct most_dev *mdev, int channel,
struct mbo *mbo) struct mbo *mbo)
{ {
struct most_channel_config *const conf = &mdev->conf[channel]; struct most_channel_config *const conf = &mdev->conf[channel];
unsigned int frame_size = get_stream_frame_size(conf); unsigned int frame_size = get_stream_frame_size(conf, &mdev->dev);
unsigned int j, num_frames; unsigned int j, num_frames;
if (!frame_size) if (!frame_size)
...@@ -697,7 +697,7 @@ static int hdm_configure_channel(struct most_interface *iface, int channel, ...@@ -697,7 +697,7 @@ static int hdm_configure_channel(struct most_interface *iface, int channel,
mdev->padding_active[channel] = true; mdev->padding_active[channel] = true;
frame_size = get_stream_frame_size(conf); frame_size = get_stream_frame_size(conf, &mdev->dev);
if (frame_size == 0 || frame_size > USB_MTU) { if (frame_size == 0 || frame_size > USB_MTU) {
dev_warn(dev, "Misconfig: frame size wrong\n"); dev_warn(dev, "Misconfig: frame size wrong\n");
return -EINVAL; return -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment