Commit d5aa19c9 authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

media: si470x: consolidate multiple printk's

When the version warning is given, multiple dev_warn() are
called. Consolidate the ones that could be merged altogether.
Suggested-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 12c762e0
...@@ -334,7 +334,6 @@ static int si470x_i2c_probe(struct i2c_client *client) ...@@ -334,7 +334,6 @@ static int si470x_i2c_probe(struct i2c_client *client)
{ {
struct si470x_device *radio; struct si470x_device *radio;
int retval = 0; int retval = 0;
unsigned char version_warning = 0;
/* private data allocation and initialization */ /* private data allocation and initialization */
radio = devm_kzalloc(&client->dev, sizeof(*radio), GFP_KERNEL); radio = devm_kzalloc(&client->dev, sizeof(*radio), GFP_KERNEL);
...@@ -410,20 +409,10 @@ static int si470x_i2c_probe(struct i2c_client *client) ...@@ -410,20 +409,10 @@ static int si470x_i2c_probe(struct i2c_client *client)
radio->registers[DEVICEID], radio->registers[SI_CHIPID]); radio->registers[DEVICEID], radio->registers[SI_CHIPID]);
if ((radio->registers[SI_CHIPID] & SI_CHIPID_FIRMWARE) < RADIO_FW_VERSION) { if ((radio->registers[SI_CHIPID] & SI_CHIPID_FIRMWARE) < RADIO_FW_VERSION) {
dev_warn(&client->dev, dev_warn(&client->dev,
"This driver is known to work with firmware version %u,\n", "This driver is known to work with firmware version %u, but the device has firmware version %u.\n"
RADIO_FW_VERSION); "If you have some trouble using this driver, please report to V4L ML at linux-media@vger.kernel.org\n",
dev_warn(&client->dev, RADIO_FW_VERSION,
"but the device has firmware version %u.\n",
radio->registers[SI_CHIPID] & SI_CHIPID_FIRMWARE); radio->registers[SI_CHIPID] & SI_CHIPID_FIRMWARE);
version_warning = 1;
}
/* give out version warning */
if (version_warning == 1) {
dev_warn(&client->dev,
"If you have some trouble using this driver,\n");
dev_warn(&client->dev,
"please report to V4L ML at linux-media@vger.kernel.org\n");
} }
/* set initial frequency */ /* set initial frequency */
......
...@@ -681,10 +681,8 @@ static int si470x_usb_driver_probe(struct usb_interface *intf, ...@@ -681,10 +681,8 @@ static int si470x_usb_driver_probe(struct usb_interface *intf,
radio->registers[DEVICEID], radio->registers[SI_CHIPID]); radio->registers[DEVICEID], radio->registers[SI_CHIPID]);
if ((radio->registers[SI_CHIPID] & SI_CHIPID_FIRMWARE) < RADIO_FW_VERSION) { if ((radio->registers[SI_CHIPID] & SI_CHIPID_FIRMWARE) < RADIO_FW_VERSION) {
dev_warn(&intf->dev, dev_warn(&intf->dev,
"This driver is known to work with firmware version %u,\n", "This driver is known to work with firmware version %u, but the device has firmware version %u.\n",
RADIO_FW_VERSION); RADIO_FW_VERSION,
dev_warn(&intf->dev,
"but the device has firmware version %u.\n",
radio->registers[SI_CHIPID] & SI_CHIPID_FIRMWARE); radio->registers[SI_CHIPID] & SI_CHIPID_FIRMWARE);
version_warning = 1; version_warning = 1;
} }
...@@ -698,10 +696,8 @@ static int si470x_usb_driver_probe(struct usb_interface *intf, ...@@ -698,10 +696,8 @@ static int si470x_usb_driver_probe(struct usb_interface *intf,
radio->software_version, radio->hardware_version); radio->software_version, radio->hardware_version);
if (radio->hardware_version < RADIO_HW_VERSION) { if (radio->hardware_version < RADIO_HW_VERSION) {
dev_warn(&intf->dev, dev_warn(&intf->dev,
"This driver is known to work with hardware version %u,\n", "This driver is known to work with hardware version %u, but the device has hardware version %u.\n",
RADIO_HW_VERSION); RADIO_HW_VERSION,
dev_warn(&intf->dev,
"but the device has hardware version %u.\n",
radio->hardware_version); radio->hardware_version);
version_warning = 1; version_warning = 1;
} }
...@@ -709,9 +705,7 @@ static int si470x_usb_driver_probe(struct usb_interface *intf, ...@@ -709,9 +705,7 @@ static int si470x_usb_driver_probe(struct usb_interface *intf,
/* give out version warning */ /* give out version warning */
if (version_warning == 1) { if (version_warning == 1) {
dev_warn(&intf->dev, dev_warn(&intf->dev,
"If you have some trouble using this driver,\n"); "If you have some trouble using this driver, please report to V4L ML at linux-media@vger.kernel.org\n");
dev_warn(&intf->dev,
"please report to V4L ML at linux-media@vger.kernel.org\n");
} }
/* set led to connect state */ /* set led to connect state */
......
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