@@ -70,7 +70,7 @@ static int bcm2708_set_function(struct gpio_chip *gc, unsigned offset,
70
70
unsigned gpio_field_offset = (offset - 10 * gpio_bank ) * 3 ;
71
71
72
72
//printk(KERN_ERR DRIVER_NAME ": bcm2708_gpio_set_function %p (%d,%d)\n", gc, offset, function);
73
- if (offset >= ARCH_NR_GPIOS )
73
+ if (offset >= BCM_NR_GPIOS )
74
74
return - EINVAL ;
75
75
76
76
spin_lock_irqsave (& lock , flags );
@@ -108,7 +108,7 @@ static int bcm2708_gpio_get(struct gpio_chip *gc, unsigned offset)
108
108
unsigned gpio_field_offset = (offset - 32 * gpio_bank );
109
109
unsigned lev ;
110
110
111
- if (offset >= ARCH_NR_GPIOS )
111
+ if (offset >= BCM_NR_GPIOS )
112
112
return 0 ;
113
113
lev = readl (gpio -> base + GPIOLEV (gpio_bank ));
114
114
//printk(KERN_ERR DRIVER_NAME ": bcm2708_gpio_get %p (%d)=%d\n", gc, offset, 0x1 & (lev>>gpio_field_offset));
@@ -121,7 +121,7 @@ static void bcm2708_gpio_set(struct gpio_chip *gc, unsigned offset, int value)
121
121
unsigned gpio_bank = offset / 32 ;
122
122
unsigned gpio_field_offset = (offset - 32 * gpio_bank );
123
123
//printk(KERN_ERR DRIVER_NAME ": bcm2708_gpio_set %p (%d=%d)\n", gc, offset, value);
124
- if (offset >= ARCH_NR_GPIOS )
124
+ if (offset >= BCM_NR_GPIOS )
125
125
return ;
126
126
if (value )
127
127
writel (1 << gpio_field_offset , gpio -> base + GPIOSET (gpio_bank ));
@@ -280,7 +280,7 @@ static int bcm2708_gpio_probe(struct platform_device *dev)
280
280
281
281
ucb -> gc .label = "bcm2708_gpio" ;
282
282
ucb -> gc .base = 0 ;
283
- ucb -> gc .ngpio = ARCH_NR_GPIOS ;
283
+ ucb -> gc .ngpio = BCM_NR_GPIOS ;
284
284
ucb -> gc .owner = THIS_MODULE ;
285
285
286
286
ucb -> gc .direction_input = bcm2708_gpio_dir_in ;
0 commit comments