mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-18 22:14:16 +00:00
sparc32: fix sparse warning in auxio_32.c
Fix following warning: auxio_32.c:133:33: warning: cast removes address space of expression To fix this auxio_power_register had to be defined as u8 _iomem. Use proper sbus operations on the pointer. Signed-off-by: Sam Ravnborg <sam@ravnborg.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
7738925de8
commit
d2aca8f9a6
3 changed files with 10 additions and 6 deletions
|
@ -78,7 +78,7 @@ do { \
|
||||||
|
|
||||||
|
|
||||||
/* AUXIO2 (Power Off Control) */
|
/* AUXIO2 (Power Off Control) */
|
||||||
extern __volatile__ unsigned char * auxio_power_register;
|
extern volatile u8 __iomem *auxio_power_register;
|
||||||
|
|
||||||
#define AUXIO_POWER_DETECT_FAILURE 32
|
#define AUXIO_POWER_DETECT_FAILURE 32
|
||||||
#define AUXIO_POWER_CLEAR_FAILURE 2
|
#define AUXIO_POWER_CLEAR_FAILURE 2
|
||||||
|
|
|
@ -106,7 +106,7 @@ EXPORT_SYMBOL(set_auxio);
|
||||||
|
|
||||||
/* sun4m power control register (AUXIO2) */
|
/* sun4m power control register (AUXIO2) */
|
||||||
|
|
||||||
volatile unsigned char * auxio_power_register = NULL;
|
volatile u8 __iomem *auxio_power_register = NULL;
|
||||||
|
|
||||||
void __init auxio_power_probe(void)
|
void __init auxio_power_probe(void)
|
||||||
{
|
{
|
||||||
|
@ -130,8 +130,8 @@ void __init auxio_power_probe(void)
|
||||||
r.flags = regs.which_io & 0xF;
|
r.flags = regs.which_io & 0xF;
|
||||||
r.start = regs.phys_addr;
|
r.start = regs.phys_addr;
|
||||||
r.end = regs.phys_addr + regs.reg_size - 1;
|
r.end = regs.phys_addr + regs.reg_size - 1;
|
||||||
auxio_power_register = (unsigned char *) of_ioremap(&r, 0,
|
auxio_power_register =
|
||||||
regs.reg_size, "auxpower");
|
(u8 __iomem *)of_ioremap(&r, 0, regs.reg_size, "auxpower");
|
||||||
|
|
||||||
/* Display a quick message on the console. */
|
/* Display a quick message on the console. */
|
||||||
if (auxio_power_register)
|
if (auxio_power_register)
|
||||||
|
|
|
@ -106,8 +106,12 @@ void machine_restart(char * cmd)
|
||||||
void machine_power_off(void)
|
void machine_power_off(void)
|
||||||
{
|
{
|
||||||
if (auxio_power_register &&
|
if (auxio_power_register &&
|
||||||
(strcmp(of_console_device->type, "serial") || scons_pwroff))
|
(strcmp(of_console_device->type, "serial") || scons_pwroff)) {
|
||||||
*auxio_power_register |= AUXIO_POWER_OFF;
|
u8 power_register = sbus_readb(auxio_power_register);
|
||||||
|
power_register |= AUXIO_POWER_OFF;
|
||||||
|
sbus_writeb(power_register, auxio_power_register);
|
||||||
|
}
|
||||||
|
|
||||||
machine_halt();
|
machine_halt();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue