CC: [email protected]
In-Reply-To: <[email protected]>
References: <[email protected]>
TO: Caleb Connolly <[email protected]>
TO: [email protected]
TO: Jonathan Cameron <[email protected]>
TO: "Lars-Peter Clausen" <[email protected]>
TO: Rob Herring <[email protected]>
TO: Andy Gross <[email protected]>
TO: Bjorn Andersson <[email protected]>
TO: Lee Jones <[email protected]>
TO: Stephen Boyd <[email protected]>
TO: [email protected]
TO: [email protected]
TO: [email protected]
CC: [email protected]
CC: [email protected]
CC: [email protected]

Hi Caleb,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on robh/for-next]
[also build test WARNING on jic23-iio/togreg lee-mfd/for-mfd-next linus/master 
v5.17-rc4 next-20220217]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    
https://github.com/0day-ci/linux/commits/Caleb-Connolly/iio-adc-introduce-Qualcomm-SPMI-Round-Robin-ADC/20220216-215127
base:   https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
:::::: branch date: 31 hours ago
:::::: commit date: 31 hours ago
config: arm-randconfig-m031-20220217 
(https://download.01.org/0day-ci/archive/20220218/[email protected]/config)
compiler: arm-linux-gnueabi-gcc (GCC) 11.2.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <[email protected]>
Reported-by: Dan Carpenter <[email protected]>

smatch warnings:
drivers/mfd/qcom-spmi-pmic.c:104 qcom_pmic_get() error: uninitialized symbol 
'other_usid'.

vim +/other_usid +104 drivers/mfd/qcom-spmi-pmic.c

dc716bbf1d4875 Ivan T. Ivanov 2015-03-17   58  
0e7c7a6e235e61 Caleb Connolly 2022-02-16   59  /**
0e7c7a6e235e61 Caleb Connolly 2022-02-16   60   * @brief Get a pointer to the 
base PMIC device
0e7c7a6e235e61 Caleb Connolly 2022-02-16   61   *
0e7c7a6e235e61 Caleb Connolly 2022-02-16   62   * @param dev the pmic function 
device
0e7c7a6e235e61 Caleb Connolly 2022-02-16   63   * @return const struct 
qcom_spmi_pmic*
0e7c7a6e235e61 Caleb Connolly 2022-02-16   64   *
0e7c7a6e235e61 Caleb Connolly 2022-02-16   65   * A PMIC can be represented by 
multiple SPMI devices, but
0e7c7a6e235e61 Caleb Connolly 2022-02-16   66   * only the base PMIC device 
will contain a reference to
0e7c7a6e235e61 Caleb Connolly 2022-02-16   67   * the revision information.
0e7c7a6e235e61 Caleb Connolly 2022-02-16   68   *
0e7c7a6e235e61 Caleb Connolly 2022-02-16   69   * This function takes a pointer 
to a function device and
0e7c7a6e235e61 Caleb Connolly 2022-02-16   70   * returns a pointer to the base 
PMIC device.
0e7c7a6e235e61 Caleb Connolly 2022-02-16   71   */
0e7c7a6e235e61 Caleb Connolly 2022-02-16   72  const struct qcom_spmi_pmic 
*qcom_pmic_get(struct device *dev)
0e7c7a6e235e61 Caleb Connolly 2022-02-16   73  {
0e7c7a6e235e61 Caleb Connolly 2022-02-16   74   struct spmi_device *sdev;
0e7c7a6e235e61 Caleb Connolly 2022-02-16   75   struct device_node *spmi_bus;
0e7c7a6e235e61 Caleb Connolly 2022-02-16   76   struct device_node *other_usid;
0e7c7a6e235e61 Caleb Connolly 2022-02-16   77   int function_parent_usid, ret;
0e7c7a6e235e61 Caleb Connolly 2022-02-16   78   u32 reg[2];
0e7c7a6e235e61 Caleb Connolly 2022-02-16   79  
0e7c7a6e235e61 Caleb Connolly 2022-02-16   80   if 
(!of_match_device(pmic_spmi_id_table, dev->parent))
0e7c7a6e235e61 Caleb Connolly 2022-02-16   81           return ERR_PTR(-EINVAL);
0e7c7a6e235e61 Caleb Connolly 2022-02-16   82  
0e7c7a6e235e61 Caleb Connolly 2022-02-16   83   sdev = 
to_spmi_device(dev->parent);
0e7c7a6e235e61 Caleb Connolly 2022-02-16   84   if (!sdev)
0e7c7a6e235e61 Caleb Connolly 2022-02-16   85           return ERR_PTR(-EINVAL);
0e7c7a6e235e61 Caleb Connolly 2022-02-16   86  
0e7c7a6e235e61 Caleb Connolly 2022-02-16   87   /*
0e7c7a6e235e61 Caleb Connolly 2022-02-16   88    * Quick return if the function 
device is already in the right
0e7c7a6e235e61 Caleb Connolly 2022-02-16   89    * USID
0e7c7a6e235e61 Caleb Connolly 2022-02-16   90    */
0e7c7a6e235e61 Caleb Connolly 2022-02-16   91   if (sdev->usid % 2 == 0)
0e7c7a6e235e61 Caleb Connolly 2022-02-16   92           return 
spmi_device_get_drvdata(sdev);
0e7c7a6e235e61 Caleb Connolly 2022-02-16   93  
0e7c7a6e235e61 Caleb Connolly 2022-02-16   94   function_parent_usid = 
sdev->usid;
0e7c7a6e235e61 Caleb Connolly 2022-02-16   95  
0e7c7a6e235e61 Caleb Connolly 2022-02-16   96   /*
0e7c7a6e235e61 Caleb Connolly 2022-02-16   97    * Walk through the list of 
PMICs until we find the sibling USID.
0e7c7a6e235e61 Caleb Connolly 2022-02-16   98    * The goal is the find to 
previous sibling. Assuming there is no
0e7c7a6e235e61 Caleb Connolly 2022-02-16   99    * PMIC with more than 2 USIDs. 
We know that function_parent_usid
0e7c7a6e235e61 Caleb Connolly 2022-02-16  100    * is one greater than the base 
USID.
0e7c7a6e235e61 Caleb Connolly 2022-02-16  101    */
0e7c7a6e235e61 Caleb Connolly 2022-02-16  102   spmi_bus = 
of_get_parent(sdev->dev.parent->of_node);
0e7c7a6e235e61 Caleb Connolly 2022-02-16  103   do {
0e7c7a6e235e61 Caleb Connolly 2022-02-16 @104           other_usid = 
of_get_next_child(spmi_bus, other_usid);
0e7c7a6e235e61 Caleb Connolly 2022-02-16  105           ret = 
of_property_read_u32_array(other_usid, "reg", reg, 2);
0e7c7a6e235e61 Caleb Connolly 2022-02-16  106           if (ret)
0e7c7a6e235e61 Caleb Connolly 2022-02-16  107                   return 
ERR_PTR(ret);
0e7c7a6e235e61 Caleb Connolly 2022-02-16  108           sdev = 
spmi_device_from_of(other_usid);
0e7c7a6e235e61 Caleb Connolly 2022-02-16  109           if (sdev == NULL) {
0e7c7a6e235e61 Caleb Connolly 2022-02-16  110                   /*
0e7c7a6e235e61 Caleb Connolly 2022-02-16  111                    * If the base 
USID for this PMIC hasn't probed yet
0e7c7a6e235e61 Caleb Connolly 2022-02-16  112                    * but the 
secondary USID has, then we need to defer
0e7c7a6e235e61 Caleb Connolly 2022-02-16  113                    * the function 
driver so that it will attempt to
0e7c7a6e235e61 Caleb Connolly 2022-02-16  114                    * probe again 
when the base USID is ready.
0e7c7a6e235e61 Caleb Connolly 2022-02-16  115                    */
0e7c7a6e235e61 Caleb Connolly 2022-02-16  116                   if (reg[0] == 
function_parent_usid - 1)
0e7c7a6e235e61 Caleb Connolly 2022-02-16  117                           return 
ERR_PTR(-EPROBE_DEFER);
0e7c7a6e235e61 Caleb Connolly 2022-02-16  118  
0e7c7a6e235e61 Caleb Connolly 2022-02-16  119                   continue;
0e7c7a6e235e61 Caleb Connolly 2022-02-16  120           }
0e7c7a6e235e61 Caleb Connolly 2022-02-16  121  
0e7c7a6e235e61 Caleb Connolly 2022-02-16  122           if (reg[0] == 
function_parent_usid - 1)
0e7c7a6e235e61 Caleb Connolly 2022-02-16  123                   return 
spmi_device_get_drvdata(sdev);
0e7c7a6e235e61 Caleb Connolly 2022-02-16  124   } while (other_usid->sibling);
0e7c7a6e235e61 Caleb Connolly 2022-02-16  125  
0e7c7a6e235e61 Caleb Connolly 2022-02-16  126   return ERR_PTR(-ENODATA);
0e7c7a6e235e61 Caleb Connolly 2022-02-16  127  }
0e7c7a6e235e61 Caleb Connolly 2022-02-16  128  EXPORT_SYMBOL(qcom_pmic_get);
0e7c7a6e235e61 Caleb Connolly 2022-02-16  129  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/[email protected]
_______________________________________________
kbuild mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to