Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging:iio:adc:lpc32xx rename local state structure to _state

Previously it was called _info with instances as info. This caused some
confusion against the info structure that are used in the core of IIO.

Since this driver was written it's become a fairly strong convention to
use _state and st for instances so change to that.

Signed-off-by: Jonathan Cameron <jic23@kernel.org>

+23 -23
+23 -23
drivers/staging/iio/adc/lpc32xx_adc.c
··· 61 61 62 62 #define LPC32XXAD_NAME "lpc32xx-adc" 63 63 64 - struct lpc32xx_adc_info { 64 + struct lpc32xx_adc_state { 65 65 void __iomem *adc_base; 66 66 struct clk *clk; 67 67 struct completion completion; ··· 75 75 int *val2, 76 76 long mask) 77 77 { 78 - struct lpc32xx_adc_info *info = iio_priv(indio_dev); 78 + struct lpc32xx_adc_state *st = iio_priv(indio_dev); 79 79 80 80 if (mask == IIO_CHAN_INFO_RAW) { 81 81 mutex_lock(&indio_dev->mlock); 82 - clk_prepare_enable(info->clk); 82 + clk_prepare_enable(st->clk); 83 83 /* Measurement setup */ 84 84 __raw_writel(LPC32XXAD_INTERNAL | (chan->address) | 85 85 LPC32XXAD_REFp | LPC32XXAD_REFm, 86 - LPC32XXAD_SELECT(info->adc_base)); 86 + LPC32XXAD_SELECT(st->adc_base)); 87 87 /* Trigger conversion */ 88 88 __raw_writel(LPC32XXAD_PDN_CTRL | LPC32XXAD_STROBE, 89 - LPC32XXAD_CTRL(info->adc_base)); 90 - wait_for_completion(&info->completion); /* set by ISR */ 91 - clk_disable_unprepare(info->clk); 92 - *val = info->value; 89 + LPC32XXAD_CTRL(st->adc_base)); 90 + wait_for_completion(&st->completion); /* set by ISR */ 91 + clk_disable_unprepare(st->clk); 92 + *val = st->value; 93 93 mutex_unlock(&indio_dev->mlock); 94 94 95 95 return IIO_VAL_INT; ··· 120 120 121 121 static irqreturn_t lpc32xx_adc_isr(int irq, void *dev_id) 122 122 { 123 - struct lpc32xx_adc_info *info = dev_id; 123 + struct lpc32xx_adc_state *st = dev_id; 124 124 125 125 /* Read value and clear irq */ 126 - info->value = __raw_readl(LPC32XXAD_VALUE(info->adc_base)) & 127 - LPC32XXAD_VALUE_MASK; 128 - complete(&info->completion); 126 + st->value = __raw_readl(LPC32XXAD_VALUE(st->adc_base)) & 127 + LPC32XXAD_VALUE_MASK; 128 + complete(&st->completion); 129 129 130 130 return IRQ_HANDLED; 131 131 } 132 132 133 133 static int lpc32xx_adc_probe(struct platform_device *pdev) 134 134 { 135 - struct lpc32xx_adc_info *info = NULL; 135 + struct lpc32xx_adc_state *st = NULL; 136 136 struct resource *res; 137 137 int retval = -ENODEV; 138 138 struct iio_dev *iodev = NULL; ··· 144 144 return -ENXIO; 145 145 } 146 146 147 - iodev = devm_iio_device_alloc(&pdev->dev, sizeof(*info)); 147 + iodev = devm_iio_device_alloc(&pdev->dev, sizeof(*st)); 148 148 if (!iodev) 149 149 return -ENOMEM; 150 150 151 - info = iio_priv(iodev); 151 + st = iio_priv(iodev); 152 152 153 - info->adc_base = devm_ioremap(&pdev->dev, res->start, 154 - resource_size(res)); 155 - if (!info->adc_base) { 153 + st->adc_base = devm_ioremap(&pdev->dev, res->start, 154 + resource_size(res)); 155 + if (!st->adc_base) { 156 156 dev_err(&pdev->dev, "failed mapping memory\n"); 157 157 return -EBUSY; 158 158 } 159 159 160 - info->clk = devm_clk_get(&pdev->dev, NULL); 161 - if (IS_ERR(info->clk)) { 160 + st->clk = devm_clk_get(&pdev->dev, NULL); 161 + if (IS_ERR(st->clk)) { 162 162 dev_err(&pdev->dev, "failed getting clock\n"); 163 - return PTR_ERR(info->clk); 163 + return PTR_ERR(st->clk); 164 164 } 165 165 166 166 irq = platform_get_irq(pdev, 0); ··· 170 170 } 171 171 172 172 retval = devm_request_irq(&pdev->dev, irq, lpc32xx_adc_isr, 0, 173 - LPC32XXAD_NAME, info); 173 + LPC32XXAD_NAME, st); 174 174 if (retval < 0) { 175 175 dev_err(&pdev->dev, "failed requesting interrupt\n"); 176 176 return retval; ··· 178 178 179 179 platform_set_drvdata(pdev, iodev); 180 180 181 - init_completion(&info->completion); 181 + init_completion(&st->completion); 182 182 183 183 iodev->name = LPC32XXAD_NAME; 184 184 iodev->dev.parent = &pdev->dev;