Commit 0e1a7ecd authored by Vaibhav Gupta's avatar Vaibhav Gupta

software: kernel: second parameter of ft_temperature_get() is not required

The second paramter of ft_temperature_get() is already a member of the
of the first one. Thus, the value can be stored in it within the
function itself. Aand, it doesn't changes its return behaviour.

Also, this makes the function symmetric, in terms of declaration, to
those of fmc-adc and fine-delay.
Signed-off-by: 's avatarVaibhav Gupta <vaibhav.gupta@cern.ch>
parent b17062c2
......@@ -383,7 +383,7 @@ static inline void ft_disable(struct fmctdc_dev *ft, unsigned int chan)
ft_writel(ft, ien, TDC_REG_INPUT_ENABLE);
}
extern int ft_temperature_get(struct fmctdc_dev *ft, int *temp);
extern int ft_temperature_get(struct fmctdc_dev *ft);
#endif // __KERNEL__
......
......@@ -124,16 +124,16 @@ static int ft_raw_mode_get(struct fmctdc_dev *ft,
int ft_temperature_get(struct fmctdc_dev *ft, int *temp)
int ft_temperature_get(struct fmctdc_dev *ft)
{
int stat = ft_ioread(ft, ft->ft_owregs_base + TDC_OW_REG_CSR);
if (!(stat & TDC_OW_CSR_VALID))
return -EIO;
*temp = ft_ioread(ft, ft->ft_owregs_base + TDC_OW_REG_TEMP);
ft->temp = ft_ioread(ft, ft->ft_owregs_base + TDC_OW_REG_TEMP);
return 0;
return ft->temp;
}
static int ft_unique_id_get(struct fmctdc_dev *ft, uint64_t *id)
......@@ -212,10 +212,9 @@ static int ft_zio_info_get(struct device *dev, struct zio_attribute *zattr,
*usr_val = ft->mode;
break;
case FT_ATTR_PARAM_TEMP:
ret = ft_temperature_get(ft, &ft->temp);
ret = ft_temperature_get(ft);
if (ret < 0)
return ret;
*usr_val = ft->temp;
break;
case FT_ATTR_DEV_COARSE:
case FT_ATTR_DEV_SECONDS:
......
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