data[0] = reg & 0xff;
data[1] = value & 0xff;
- if (i2c_master_send(client, data, 2) == 2) {
+ if (i2c_master_send(client, data, 2) == 2)
return 0;
- } else {
- dev_err(&bdev->client->dev, "BCM I2C error!\n");
- dev_err(&bdev->client->dev, "Is Bluetooth up and running?\n");
- return -EIO;
- }
+
+ dev_err(&bdev->client->dev, "BCM I2C error!\n");
+ dev_err(&bdev->client->dev, "Is Bluetooth up and running?\n");
+ return -EIO;
}
static int bcm2048_recv_command(struct bcm2048_device *bdev, unsigned int reg,
if (!err) {
if (value & BCM2048_DE_EMPHASIS_SELECT)
return BCM2048_DE_EMPHASIS_75us;
- else
- return BCM2048_DE_EMPHASIS_50us;
+
+ return BCM2048_DE_EMPHASIS_50us;
}
return err;
if (!bdev) \
return -ENODEV; \
\
- sscanf(buf, mask, &value); \
+ if (sscanf(buf, mask, &value) != 1) \
+ return -EINVAL; \
\
if (check) \
return -EDOM; \
i = 0;
while (i < count) {
unsigned char tmpbuf[3];
+
tmpbuf[i] = bdev->rds_info.radio_text[bdev->rd_index+i+2];
tmpbuf[i+1] = bdev->rds_info.radio_text[bdev->rd_index+i+1];
tmpbuf[i+2] = ((bdev->rds_info.radio_text[bdev->rd_index+i]
bdev = kzalloc(sizeof(*bdev), GFP_KERNEL);
if (!bdev) {
- dev_dbg(&client->dev, "Failed to alloc video device.\n");
err = -ENOMEM;
goto exit;
}