Skip to content

Commit b8f56e6

Browse files
committed
Code changes in respond to PR comments and suggestions.
Signed-off-by: Oscar Magana Pantoja <[email protected]>
1 parent d37373f commit b8f56e6

File tree

1 file changed

+19
-20
lines changed

1 file changed

+19
-20
lines changed

drivers/iio/adc/apollo/ad9088_ffh.c

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
*/
77
#include <linux/types.h>
88
#include <linux/kstrtox.h>
9-
#include <linux/kernel.h>
109
#include "ad9088.h"
1110

1211
adi_apollo_gpio_hop_profile_t hop_config = {{19, 20, 21, 22, 23}};
@@ -49,12 +48,12 @@ int ad9088_ffh_probe(struct ad9088_phy *phy)
4948

5049
/* Cache defaults */
5150
memset(&phy->ffh, 0, sizeof(union ad9088_ffh));
52-
for (uint8_t i = 0; i < ADI_APOLLO_FNCO_PROFILE_NUM; i++) {
53-
for (uint8_t j = 0; j < 2; j++)
51+
for (u8 i = 0; i < ADI_APOLLO_FNCO_PROFILE_NUM; i++) {
52+
for (u8 j = 0; j < 2; j++)
5453
phy->ffh.dir[j].fnco.mode[i] = cnco_hop_config.profile_sel_mode;
5554
}
56-
for (uint8_t i = 0; i < ADI_APOLLO_CNCO_PROFILE_NUM; i++) {
57-
for (uint8_t j = 0; j < 2; j++)
55+
for (u8 i = 0; i < ADI_APOLLO_CNCO_PROFILE_NUM; i++) {
56+
for (u8 j = 0; j < 2; j++)
5857
phy->ffh.dir[j].cnco.mode[i] = fnco_hop_config.profile_sel_mode;
5958
}
6059
return ret;
@@ -64,12 +63,12 @@ ssize_t ad9088_ext_info_read_ffh(struct iio_dev *indio_dev, uintptr_t private,
6463
const struct iio_chan_spec *chan, char *buf)
6564
{
6665
struct axiadc_converter *conv = iio_device_get_drvdata(indio_dev);
67-
uint8_t dir = chan->output ? ADI_APOLLO_TX : ADI_APOLLO_RX;
66+
u8 dir = chan->output ? ADI_APOLLO_TX : ADI_APOLLO_RX;
6867
struct ad9088_phy *phy = conv->phy;
69-
uint8_t cddc_num, fddc_num, side;
70-
uint32_t cddc_mask, fddc_mask;
71-
uint64_t val;
72-
uint8_t index;
68+
u8 cddc_num, fddc_num, side;
69+
u32 cddc_mask, fddc_mask;
70+
u64 val;
71+
u8 index;
7372

7473
guard(mutex)(&phy->lock);
7574
ad9088_iiochan_to_fddc_cddc(phy, chan, &fddc_num,
@@ -80,7 +79,7 @@ ssize_t ad9088_ext_info_read_ffh(struct iio_dev *indio_dev, uintptr_t private,
8079
val = phy->ffh.dir[dir].fnco.index[fddc_num];
8180
break;
8281
case FFH_FNCO_FREQUENCY:
83-
index = phy->ffh.dir[dir].fnco.index[cddc_num];
82+
index = phy->ffh.dir[dir].fnco.index[fddc_num];
8483
if (index >= ADI_APOLLO_FNCO_PROFILE_NUM)
8584
return -EINVAL;
8685
val = phy->ffh.dir[dir].fnco.frequency[index];
@@ -117,17 +116,17 @@ ssize_t ad9088_ext_info_write_ffh(struct iio_dev *indio_dev, uintptr_t private,
117116
const char *buf, size_t len)
118117
{
119118
struct axiadc_converter *conv = iio_device_get_drvdata(indio_dev);
120-
uint8_t dir = chan->output ? ADI_APOLLO_TX : ADI_APOLLO_RX;
121-
uint8_t cddc_num, fddc_num, side, fnco_num, cnco_num;
122-
uint8_t index;
119+
u8 dir = chan->output ? ADI_APOLLO_TX : ADI_APOLLO_RX;
120+
u8 cddc_num, fddc_num, side, fnco_num, cnco_num;
121+
u8 index;
123122
struct ad9088_phy *phy = conv->phy;
124-
uint32_t cddc_mask, fddc_mask, ftw_u32;
125-
uint32_t cddc_dcm;
126-
uint16_t fnco_en, cnco_en;
123+
u32 cddc_mask, fddc_mask, ftw_u32;
124+
u32 cddc_dcm;
125+
u16 fnco_en, cnco_en;
127126
bool hop_enable;
128-
uint64_t val, ret;
129-
uint64_t ftw_u64, f, tmp;
130-
uint64_t gpio, val2;
127+
u64 val, ret;
128+
u64 ftw_u64, f, tmp;
129+
u64 gpio, val2;
131130

132131
guard(mutex)(&phy->lock);
133132
ad9088_iiochan_to_fddc_cddc(phy, chan, &fddc_num,

0 commit comments

Comments
 (0)