staging: comedi: jr3_pci: add __iomem tags
Tag pointers to remapped I/O memory with `__iomem` and remove the `volatile` qualifiers. Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
7195ea042c
commit
95b24682d6
2 changed files with 21 additions and 21 deletions
|
@ -62,7 +62,7 @@ struct jr3_pci_dev_private {
|
||||||
|
|
||||||
struct pci_dev *pci_dev;
|
struct pci_dev *pci_dev;
|
||||||
int pci_enabled;
|
int pci_enabled;
|
||||||
volatile struct jr3_t *iobase;
|
struct jr3_t __iomem *iobase;
|
||||||
int n_channels;
|
int n_channels;
|
||||||
struct timer_list timer;
|
struct timer_list timer;
|
||||||
};
|
};
|
||||||
|
@ -74,7 +74,7 @@ struct poll_delay_t {
|
||||||
};
|
};
|
||||||
|
|
||||||
struct jr3_pci_subdev_private {
|
struct jr3_pci_subdev_private {
|
||||||
volatile struct jr3_channel *channel;
|
struct jr3_channel __iomem *channel;
|
||||||
unsigned long next_time_min;
|
unsigned long next_time_min;
|
||||||
unsigned long next_time_max;
|
unsigned long next_time_max;
|
||||||
enum { state_jr3_poll,
|
enum { state_jr3_poll,
|
||||||
|
@ -138,7 +138,7 @@ static struct poll_delay_t poll_delay_min_max(int min, int max)
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int is_complete(volatile struct jr3_channel *channel)
|
static int is_complete(struct jr3_channel __iomem *channel)
|
||||||
{
|
{
|
||||||
return get_s16(&channel->command_word0) == 0;
|
return get_s16(&channel->command_word0) == 0;
|
||||||
}
|
}
|
||||||
|
@ -150,7 +150,7 @@ struct transform_t {
|
||||||
} link[8];
|
} link[8];
|
||||||
};
|
};
|
||||||
|
|
||||||
static void set_transforms(volatile struct jr3_channel *channel,
|
static void set_transforms(struct jr3_channel __iomem *channel,
|
||||||
struct transform_t transf, short num)
|
struct transform_t transf, short num)
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
@ -169,18 +169,18 @@ static void set_transforms(volatile struct jr3_channel *channel,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void use_transform(volatile struct jr3_channel *channel,
|
static void use_transform(struct jr3_channel __iomem *channel,
|
||||||
short transf_num)
|
short transf_num)
|
||||||
{
|
{
|
||||||
set_s16(&channel->command_word0, 0x0500 + (transf_num & 0x000f));
|
set_s16(&channel->command_word0, 0x0500 + (transf_num & 0x000f));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void use_offset(volatile struct jr3_channel *channel, short offset_num)
|
static void use_offset(struct jr3_channel __iomem *channel, short offset_num)
|
||||||
{
|
{
|
||||||
set_s16(&channel->command_word0, 0x0600 + (offset_num & 0x000f));
|
set_s16(&channel->command_word0, 0x0600 + (offset_num & 0x000f));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void set_offset(volatile struct jr3_channel *channel)
|
static void set_offset(struct jr3_channel __iomem *channel)
|
||||||
{
|
{
|
||||||
set_s16(&channel->command_word0, 0x0700);
|
set_s16(&channel->command_word0, 0x0700);
|
||||||
}
|
}
|
||||||
|
@ -194,7 +194,7 @@ struct six_axis_t {
|
||||||
s16 mz;
|
s16 mz;
|
||||||
};
|
};
|
||||||
|
|
||||||
static void set_full_scales(volatile struct jr3_channel *channel,
|
static void set_full_scales(struct jr3_channel __iomem *channel,
|
||||||
struct six_axis_t full_scale)
|
struct six_axis_t full_scale)
|
||||||
{
|
{
|
||||||
printk("%d %d %d %d %d %d\n",
|
printk("%d %d %d %d %d %d\n",
|
||||||
|
@ -210,7 +210,7 @@ static void set_full_scales(volatile struct jr3_channel *channel,
|
||||||
set_s16(&channel->command_word0, 0x0a00);
|
set_s16(&channel->command_word0, 0x0a00);
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct six_axis_t get_min_full_scales(volatile struct jr3_channel
|
static struct six_axis_t get_min_full_scales(struct jr3_channel __iomem
|
||||||
*channel)
|
*channel)
|
||||||
{
|
{
|
||||||
struct six_axis_t result;
|
struct six_axis_t result;
|
||||||
|
@ -223,7 +223,7 @@ static struct six_axis_t get_min_full_scales(volatile struct jr3_channel
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct six_axis_t get_max_full_scales(volatile struct jr3_channel
|
static struct six_axis_t get_max_full_scales(struct jr3_channel __iomem
|
||||||
*channel)
|
*channel)
|
||||||
{
|
{
|
||||||
struct six_axis_t result;
|
struct six_axis_t result;
|
||||||
|
@ -492,7 +492,7 @@ static struct poll_delay_t jr3_pci_poll_subdevice(struct comedi_subdevice *s)
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
if (p) {
|
if (p) {
|
||||||
volatile struct jr3_channel *channel = p->channel;
|
struct jr3_channel __iomem *channel = p->channel;
|
||||||
int errors = get_u16(&channel->errors);
|
int errors = get_u16(&channel->errors);
|
||||||
|
|
||||||
if (errors != p->errors) {
|
if (errors != p->errors) {
|
||||||
|
@ -607,7 +607,7 @@ static struct poll_delay_t jr3_pci_poll_subdevice(struct comedi_subdevice *s)
|
||||||
is_complete(channel));
|
is_complete(channel));
|
||||||
result = poll_delay_min_max(20, 100);
|
result = poll_delay_min_max(20, 100);
|
||||||
} else {
|
} else {
|
||||||
volatile struct force_array *full_scale;
|
struct force_array __iomem *full_scale;
|
||||||
|
|
||||||
/* Use ranges in kN or we will overflow arount 2000N! */
|
/* Use ranges in kN or we will overflow arount 2000N! */
|
||||||
full_scale = &channel->full_scale;
|
full_scale = &channel->full_scale;
|
||||||
|
@ -849,8 +849,8 @@ static int jr3_pci_attach(struct comedi_device *dev,
|
||||||
p->channel = &devpriv->iobase->channel[i].data;
|
p->channel = &devpriv->iobase->channel[i].data;
|
||||||
dev_dbg(dev->class_dev, "p->channel %p %p (%tx)\n",
|
dev_dbg(dev->class_dev, "p->channel %p %p (%tx)\n",
|
||||||
p->channel, devpriv->iobase,
|
p->channel, devpriv->iobase,
|
||||||
((char *)(p->channel) -
|
((char __iomem *)p->channel -
|
||||||
(char *)(devpriv->iobase)));
|
(char __iomem *)devpriv->iobase));
|
||||||
p->channel_no = i;
|
p->channel_no = i;
|
||||||
for (j = 0; j < 8; j++) {
|
for (j = 0; j < 8; j++) {
|
||||||
int k;
|
int k;
|
||||||
|
@ -941,7 +941,7 @@ static void jr3_pci_detach(struct comedi_device *dev)
|
||||||
kfree(dev->subdevices[i].private);
|
kfree(dev->subdevices[i].private);
|
||||||
}
|
}
|
||||||
if (devpriv->iobase)
|
if (devpriv->iobase)
|
||||||
iounmap((void *)devpriv->iobase);
|
iounmap(devpriv->iobase);
|
||||||
if (devpriv->pci_enabled)
|
if (devpriv->pci_enabled)
|
||||||
comedi_pci_disable(devpriv->pci_dev);
|
comedi_pci_disable(devpriv->pci_dev);
|
||||||
if (devpriv->pci_dev)
|
if (devpriv->pci_dev)
|
||||||
|
|
|
@ -2,22 +2,22 @@
|
||||||
* is 16 bits, but aligned on a 32 bit PCI boundary
|
* is 16 bits, but aligned on a 32 bit PCI boundary
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static inline u16 get_u16(volatile const u32 * p)
|
static inline u16 get_u16(const u32 __iomem *p)
|
||||||
{
|
{
|
||||||
return (u16) readl(p);
|
return (u16)readl(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void set_u16(volatile u32 * p, u16 val)
|
static inline void set_u16(u32 __iomem *p, u16 val)
|
||||||
{
|
{
|
||||||
writel(val, p);
|
writel(val, p);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline s16 get_s16(volatile const s32 * p)
|
static inline s16 get_s16(const s32 __iomem *p)
|
||||||
{
|
{
|
||||||
return (s16) readl(p);
|
return (s16)readl(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void set_s16(volatile s32 * p, s16 val)
|
static inline void set_s16(s32 __iomem *p, s16 val)
|
||||||
{
|
{
|
||||||
writel(val, p);
|
writel(val, p);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue