summaryrefslogtreecommitdiffstats
path: root/drivers/usb/misc/sisusbvga/sisusb.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-06-26 15:59:26 -0700
committerLinus Torvalds <torvalds@linux-foundation.org>2015-06-26 15:59:26 -0700
commit2a298679b41199ae742a77ce69766385dffe816f (patch)
tree93a23c0d828ccca7053f604dbfcdd4d3278972b3 /drivers/usb/misc/sisusbvga/sisusb.c
parent8c7febe83915332276cab49e89f6580bb963fb9a (diff)
parent50641056d833813b71b0ad51823f7ded8dd62e7f (diff)
downloadlinux-2a298679b41199ae742a77ce69766385dffe816f.tar.gz
linux-2a298679b41199ae742a77ce69766385dffe816f.tar.bz2
linux-2a298679b41199ae742a77ce69766385dffe816f.zip
Merge tag 'usb-4.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb
Pull USB updates from Greg KH: "Here's the big USB patchset for 4.2-rc1. As is normal these days, the majority of changes are in the gadget drivers, with a bunch of other small driver changes. All of these have been in linux-next with no reported issues" * tag 'usb-4.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (175 commits) usb: dwc3: Use ASCII space in Kconfig usb: chipidea: add work-around for Marvell HSIC PHY startup usb: chipidea: allow multiple instances to use default ci_default_pdata dt-bindings: Consolidate ChipIdea USB ci13xxx bindings phy: add Marvell HSIC 28nm PHY phy: Add Marvell USB 2.0 OTG 28nm PHY dt-bindings: Add Marvell PXA1928 USB and HSIC PHY bindings USB: ssb: use devm_kzalloc USB: ssb: fix error handling in ssb_hcd_create_pdev() usb: isp1760: check for null return from kzalloc cdc-acm: Add support of ATOL FPrint fiscal printers usb: chipidea: usbmisc_imx: Remove unneeded semicolon USB: usbtmc: add device quirk for Rigol DS6104 USB: serial: mos7840: Use setup_timer phy: twl4030-usb: add ABI documentation phy: twl4030-usb: remove incorrect pm_runtime_get_sync() in probe function. phy: twl4030-usb: remove pointless 'suspended' test in 'suspend' callback. phy: twl4030-usb: make runtime pm more reliable. drivers:usb:fsl: Fix compilation error for fsl ehci drv usb: renesas_usbhs: Don't disable the pipe if Control write status stage ...
Diffstat (limited to 'drivers/usb/misc/sisusbvga/sisusb.c')
-rw-r--r--drivers/usb/misc/sisusbvga/sisusb.c39
1 files changed, 26 insertions, 13 deletions
diff --git a/drivers/usb/misc/sisusbvga/sisusb.c b/drivers/usb/misc/sisusbvga/sisusb.c
index 022dc0008f2a..306d6852ebc7 100644
--- a/drivers/usb/misc/sisusbvga/sisusb.c
+++ b/drivers/usb/misc/sisusbvga/sisusb.c
@@ -2316,10 +2316,12 @@ sisusb_reset_text_mode(struct sisusb_usb_data *sisusb, int init)
/* Set mode 0x03 */
SiSUSBSetMode(sisusb->SiS_Pr, 0x03);
- if (!(myfont = find_font("VGA8x16")))
+ myfont = find_font("VGA8x16");
+ if (!myfont)
return 1;
- if (!(tempbuf = vmalloc(8192)))
+ tempbuf = vmalloc(8192);
+ if (!tempbuf)
return 1;
for (i = 0; i < 256; i++)
@@ -2342,7 +2344,8 @@ sisusb_reset_text_mode(struct sisusb_usb_data *sisusb, int init)
if (init && !sisusb->scrbuf) {
- if ((tempbuf = vmalloc(8192))) {
+ tempbuf = vmalloc(8192);
+ if (tempbuf) {
i = 4096;
tempbufb = (u16 *)tempbuf;
@@ -2417,11 +2420,13 @@ sisusb_open(struct inode *inode, struct file *file)
struct usb_interface *interface;
int subminor = iminor(inode);
- if (!(interface = usb_find_interface(&sisusb_driver, subminor))) {
+ interface = usb_find_interface(&sisusb_driver, subminor);
+ if (!interface) {
return -ENODEV;
}
- if (!(sisusb = usb_get_intfdata(interface))) {
+ sisusb = usb_get_intfdata(interface);
+ if (!sisusb) {
return -ENODEV;
}
@@ -2488,7 +2493,8 @@ sisusb_release(struct inode *inode, struct file *file)
{
struct sisusb_usb_data *sisusb;
- if (!(sisusb = file->private_data))
+ sisusb = file->private_data;
+ if (!sisusb)
return -ENODEV;
mutex_lock(&sisusb->lock);
@@ -2520,7 +2526,8 @@ sisusb_read(struct file *file, char __user *buffer, size_t count, loff_t *ppos)
u16 buf16;
u32 buf32, address;
- if (!(sisusb = file->private_data))
+ sisusb = file->private_data;
+ if (!sisusb)
return -ENODEV;
mutex_lock(&sisusb->lock);
@@ -2662,7 +2669,8 @@ sisusb_write(struct file *file, const char __user *buffer, size_t count,
u16 buf16;
u32 buf32, address;
- if (!(sisusb = file->private_data))
+ sisusb = file->private_data;
+ if (!sisusb)
return -ENODEV;
mutex_lock(&sisusb->lock);
@@ -2805,7 +2813,8 @@ sisusb_lseek(struct file *file, loff_t offset, int orig)
struct sisusb_usb_data *sisusb;
loff_t ret;
- if (!(sisusb = file->private_data))
+ sisusb = file->private_data;
+ if (!sisusb)
return -ENODEV;
mutex_lock(&sisusb->lock);
@@ -2970,7 +2979,8 @@ sisusb_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
long retval = 0;
u32 __user *argp = (u32 __user *)arg;
- if (!(sisusb = file->private_data))
+ sisusb = file->private_data;
+ if (!sisusb)
return -ENODEV;
mutex_lock(&sisusb->lock);
@@ -3084,7 +3094,8 @@ static int sisusb_probe(struct usb_interface *intf,
dev->devnum);
/* Allocate memory for our private */
- if (!(sisusb = kzalloc(sizeof(*sisusb), GFP_KERNEL))) {
+ sisusb = kzalloc(sizeof(*sisusb), GFP_KERNEL);
+ if (!sisusb) {
dev_err(&dev->dev, "Failed to allocate memory for private data\n");
return -ENOMEM;
}
@@ -3093,7 +3104,8 @@ static int sisusb_probe(struct usb_interface *intf,
mutex_init(&(sisusb->lock));
/* Register device */
- if ((retval = usb_register_dev(intf, &usb_sisusb_class))) {
+ retval = usb_register_dev(intf, &usb_sisusb_class);
+ if (retval) {
dev_err(&sisusb->sisusb_dev->dev, "Failed to get a minor for device %d\n",
dev->devnum);
retval = -ENODEV;
@@ -3214,7 +3226,8 @@ static void sisusb_disconnect(struct usb_interface *intf)
struct sisusb_usb_data *sisusb;
/* This should *not* happen */
- if (!(sisusb = usb_get_intfdata(intf)))
+ sisusb = usb_get_intfdata(intf);
+ if (!sisusb)
return;
#ifdef INCL_SISUSB_CON