Hi Kieran,

I love your patch! Perhaps something to improve:

[auto build test WARNING on linuxtv-media/master]
[also build test WARNING on v4.18-rc8 next-20180810]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:    
https://github.com/0day-ci/linux/commits/Kieran-Bingham/dt-bindings-media-i2c-Add-bindings-for-Maxim-Integrated-MAX9286/20180811-061941
base:   git://linuxtv.org/media_tree.git master

smatch warnings:
drivers/media/i2c/rdacm20.c:562 rdacm20_probe() warn: passing zero to 'PTR_ERR'

# 
https://github.com/0day-ci/linux/commit/7edd41b0fa329758ff0e755621260d40ebd3cafb
git remote add linux-review https://github.com/0day-ci/linux
git remote update linux-review
git checkout 7edd41b0fa329758ff0e755621260d40ebd3cafb
vim +/PTR_ERR +562 drivers/media/i2c/rdacm20.c

7edd41b0 Kieran Bingham 2018-08-08  509  
7edd41b0 Kieran Bingham 2018-08-08  510  static int rdacm20_probe(struct 
i2c_client *client,
7edd41b0 Kieran Bingham 2018-08-08  511                          const struct 
i2c_device_id *did)
7edd41b0 Kieran Bingham 2018-08-08  512  {
7edd41b0 Kieran Bingham 2018-08-08  513         struct rdacm20_device *dev;
7edd41b0 Kieran Bingham 2018-08-08  514         struct fwnode_handle *ep;
7edd41b0 Kieran Bingham 2018-08-08  515         int ret;
7edd41b0 Kieran Bingham 2018-08-08  516  
7edd41b0 Kieran Bingham 2018-08-08  517         dev = kzalloc(sizeof(*dev), 
GFP_KERNEL);
7edd41b0 Kieran Bingham 2018-08-08  518         if (!dev)
7edd41b0 Kieran Bingham 2018-08-08  519                 return -ENOMEM;
7edd41b0 Kieran Bingham 2018-08-08  520  
7edd41b0 Kieran Bingham 2018-08-08  521         dev->client = client;
7edd41b0 Kieran Bingham 2018-08-08  522  
7edd41b0 Kieran Bingham 2018-08-08  523         /* Create the dummy I2C client 
for the sensor. */
7edd41b0 Kieran Bingham 2018-08-08  524         dev->sensor = 
i2c_new_dummy(client->adapter, OV10635_I2C_ADDRESS);
7edd41b0 Kieran Bingham 2018-08-08  525         if (!dev->sensor) {
7edd41b0 Kieran Bingham 2018-08-08  526                 ret = -ENXIO;
7edd41b0 Kieran Bingham 2018-08-08  527                 goto error;
7edd41b0 Kieran Bingham 2018-08-08  528         }
7edd41b0 Kieran Bingham 2018-08-08  529  
7edd41b0 Kieran Bingham 2018-08-08  530         /* Initialize the hardware. */
7edd41b0 Kieran Bingham 2018-08-08  531         ret = rdacm20_initialize(dev);
7edd41b0 Kieran Bingham 2018-08-08  532         if (ret < 0)
7edd41b0 Kieran Bingham 2018-08-08  533                 goto error;
7edd41b0 Kieran Bingham 2018-08-08  534  
7edd41b0 Kieran Bingham 2018-08-08  535         /* Initialize and register the 
subdevice. */
7edd41b0 Kieran Bingham 2018-08-08  536         v4l2_i2c_subdev_init(&dev->sd, 
client, &rdacm20_subdev_ops);
7edd41b0 Kieran Bingham 2018-08-08  537         dev->sd.flags = 
V4L2_SUBDEV_FL_HAS_DEVNODE;
7edd41b0 Kieran Bingham 2018-08-08  538  
7edd41b0 Kieran Bingham 2018-08-08  539         
v4l2_ctrl_handler_init(&dev->ctrls, 1);
7edd41b0 Kieran Bingham 2018-08-08  540         /*
7edd41b0 Kieran Bingham 2018-08-08  541          * FIXME: Compute the real 
pixel rate. The 50 MP/s value comes from the
7edd41b0 Kieran Bingham 2018-08-08  542          * hardcoded frequency in the 
BSP CSI-2 receiver driver.
7edd41b0 Kieran Bingham 2018-08-08  543          */
7edd41b0 Kieran Bingham 2018-08-08  544         v4l2_ctrl_new_std(&dev->ctrls, 
NULL, V4L2_CID_PIXEL_RATE, 50000000,
7edd41b0 Kieran Bingham 2018-08-08  545                           50000000, 1, 
50000000);
7edd41b0 Kieran Bingham 2018-08-08  546         dev->sd.ctrl_handler = 
&dev->ctrls;
7edd41b0 Kieran Bingham 2018-08-08  547  
7edd41b0 Kieran Bingham 2018-08-08  548         ret = dev->ctrls.error;
7edd41b0 Kieran Bingham 2018-08-08  549         if (ret)
7edd41b0 Kieran Bingham 2018-08-08  550                 goto error;
7edd41b0 Kieran Bingham 2018-08-08  551  
7edd41b0 Kieran Bingham 2018-08-08  552         dev->pad.flags = 
MEDIA_PAD_FL_SOURCE;
7edd41b0 Kieran Bingham 2018-08-08  553         dev->sd.entity.flags |= 
MEDIA_ENT_F_CAM_SENSOR;
7edd41b0 Kieran Bingham 2018-08-08  554         ret = 
media_entity_pads_init(&dev->sd.entity, 1, &dev->pad);
7edd41b0 Kieran Bingham 2018-08-08  555         if (ret < 0)
7edd41b0 Kieran Bingham 2018-08-08  556                 goto error;
7edd41b0 Kieran Bingham 2018-08-08  557  
7edd41b0 Kieran Bingham 2018-08-08  558         ep = 
fwnode_graph_get_next_endpoint(dev_fwnode(&client->dev), NULL);
7edd41b0 Kieran Bingham 2018-08-08  559         if (!ep) {
7edd41b0 Kieran Bingham 2018-08-08  560                 dev_err(&client->dev,
7edd41b0 Kieran Bingham 2018-08-08  561                         "Unable to get 
endpoint in node %pOF: %ld\n",
7edd41b0 Kieran Bingham 2018-08-08 @562                         
client->dev.of_node, PTR_ERR(ep));
                                                                                
     ^^^^^^^^^^^
You could just remove this.

7edd41b0 Kieran Bingham 2018-08-08  563                 ret = -ENOENT;
7edd41b0 Kieran Bingham 2018-08-08  564                 goto error;
7edd41b0 Kieran Bingham 2018-08-08  565         }
7edd41b0 Kieran Bingham 2018-08-08  566         dev->sd.fwnode = ep;
7edd41b0 Kieran Bingham 2018-08-08  567  
7edd41b0 Kieran Bingham 2018-08-08  568         ret = 
v4l2_async_register_subdev(&dev->sd);
7edd41b0 Kieran Bingham 2018-08-08  569         if (ret)
7edd41b0 Kieran Bingham 2018-08-08  570                 goto error_put_node;
7edd41b0 Kieran Bingham 2018-08-08  571  
7edd41b0 Kieran Bingham 2018-08-08  572         return 0;
7edd41b0 Kieran Bingham 2018-08-08  573  
7edd41b0 Kieran Bingham 2018-08-08  574  error_put_node:
7edd41b0 Kieran Bingham 2018-08-08  575         fwnode_handle_put(ep);
7edd41b0 Kieran Bingham 2018-08-08  576  error:
7edd41b0 Kieran Bingham 2018-08-08  577         
media_entity_cleanup(&dev->sd.entity);
7edd41b0 Kieran Bingham 2018-08-08  578         if (dev->sensor)
7edd41b0 Kieran Bingham 2018-08-08  579                 
i2c_unregister_device(dev->sensor);
7edd41b0 Kieran Bingham 2018-08-08  580         kfree(dev);
7edd41b0 Kieran Bingham 2018-08-08  581  
7edd41b0 Kieran Bingham 2018-08-08  582         dev_err(&client->dev, "probe 
failed\n");
7edd41b0 Kieran Bingham 2018-08-08  583  
7edd41b0 Kieran Bingham 2018-08-08  584         return ret;
7edd41b0 Kieran Bingham 2018-08-08  585  }
7edd41b0 Kieran Bingham 2018-08-08  586  

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
_______________________________________________
kbuild mailing list
kbuild@lists.01.org
https://lists.01.org/mailman/listinfo/kbuild

Reply via email to