Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
475d5928
Commit
475d5928
authored
Aug 02, 2014
by
Ralf Baechle
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch '3.16-fixes' into mips-for-linux-next
parents
c6b7b9f2
1062080a
Changes
15
Show whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
116 additions
and
28 deletions
+116
-28
arch/mips/jz4740/platform.c
arch/mips/jz4740/platform.c
+1
-1
arch/mips/kernel/ftrace.c
arch/mips/kernel/ftrace.c
+47
-9
arch/mips/kernel/mcount.S
arch/mips/kernel/mcount.S
+13
-0
arch/mips/kernel/ptrace.c
arch/mips/kernel/ptrace.c
+2
-1
arch/mips/kernel/rtlx-cmp.c
arch/mips/kernel/rtlx-cmp.c
+3
-0
arch/mips/kernel/rtlx-mt.c
arch/mips/kernel/rtlx-mt.c
+3
-0
arch/mips/kernel/scall64-n32.S
arch/mips/kernel/scall64-n32.S
+1
-1
arch/mips/kernel/smp-mt.c
arch/mips/kernel/smp-mt.c
+2
-0
arch/mips/kernel/unaligned.c
arch/mips/kernel/unaligned.c
+0
-1
arch/mips/math-emu/cp1emu.c
arch/mips/math-emu/cp1emu.c
+1
-1
arch/mips/mm/tlbex.c
arch/mips/mm/tlbex.c
+3
-0
arch/mips/rb532/devices.c
arch/mips/rb532/devices.c
+1
-0
arch/mips/sgi-ip22/ip22-gio.c
arch/mips/sgi-ip22/ip22-gio.c
+9
-1
arch/mips/txx9/generic/7segled.c
arch/mips/txx9/generic/7segled.c
+11
-3
arch/mips/txx9/generic/setup.c
arch/mips/txx9/generic/setup.c
+19
-10
No files found.
arch/mips/jz4740/platform.c
View file @
475d5928
...
@@ -59,7 +59,7 @@ struct platform_device jz4740_usb_ohci_device = {
...
@@ -59,7 +59,7 @@ struct platform_device jz4740_usb_ohci_device = {
/* USB Device Controller */
/* USB Device Controller */
struct
platform_device
jz4740_udc_xceiv_device
=
{
struct
platform_device
jz4740_udc_xceiv_device
=
{
.
name
=
"usb_phy_gen
_xceiv
"
,
.
name
=
"usb_phy_gen
eric
"
,
.
id
=
0
,
.
id
=
0
,
};
};
...
...
arch/mips/kernel/ftrace.c
View file @
475d5928
...
@@ -63,7 +63,7 @@ static inline int in_kernel_space(unsigned long ip)
...
@@ -63,7 +63,7 @@ static inline int in_kernel_space(unsigned long ip)
((unsigned int)(JAL | (((addr) >> 2) & ADDR_MASK)))
((unsigned int)(JAL | (((addr) >> 2) & ADDR_MASK)))
static
unsigned
int
insn_jal_ftrace_caller
__read_mostly
;
static
unsigned
int
insn_jal_ftrace_caller
__read_mostly
;
static
unsigned
int
insn_l
ui_v1_hi16_mcount
__read_mostly
;
static
unsigned
int
insn_l
a_mcount
[
2
]
__read_mostly
;
static
unsigned
int
insn_j_ftrace_graph_caller
__maybe_unused
__read_mostly
;
static
unsigned
int
insn_j_ftrace_graph_caller
__maybe_unused
__read_mostly
;
static
inline
void
ftrace_dyn_arch_init_insns
(
void
)
static
inline
void
ftrace_dyn_arch_init_insns
(
void
)
...
@@ -71,10 +71,10 @@ static inline void ftrace_dyn_arch_init_insns(void)
...
@@ -71,10 +71,10 @@ static inline void ftrace_dyn_arch_init_insns(void)
u32
*
buf
;
u32
*
buf
;
unsigned
int
v1
;
unsigned
int
v1
;
/* l
ui v1, hi16
_mcount */
/* l
a v1,
_mcount */
v1
=
3
;
v1
=
3
;
buf
=
(
u32
*
)
&
insn_l
ui_v1_hi16_mcount
;
buf
=
(
u32
*
)
&
insn_l
a_mcount
[
0
]
;
UASM_i_LA
_mostly
(
&
buf
,
v1
,
MCOUNT_ADDR
);
UASM_i_LA
(
&
buf
,
v1
,
MCOUNT_ADDR
);
/* jal (ftrace_caller + 8), jump over the first two instruction */
/* jal (ftrace_caller + 8), jump over the first two instruction */
buf
=
(
u32
*
)
&
insn_jal_ftrace_caller
;
buf
=
(
u32
*
)
&
insn_jal_ftrace_caller
;
...
@@ -111,14 +111,47 @@ static int ftrace_modify_code_2(unsigned long ip, unsigned int new_code1,
...
@@ -111,14 +111,47 @@ static int ftrace_modify_code_2(unsigned long ip, unsigned int new_code1,
unsigned
int
new_code2
)
unsigned
int
new_code2
)
{
{
int
faulted
;
int
faulted
;
mm_segment_t
old_fs
;
safe_store_code
(
new_code1
,
ip
,
faulted
);
safe_store_code
(
new_code1
,
ip
,
faulted
);
if
(
unlikely
(
faulted
))
if
(
unlikely
(
faulted
))
return
-
EFAULT
;
return
-
EFAULT
;
safe_store_code
(
new_code2
,
ip
+
4
,
faulted
);
ip
+=
4
;
safe_store_code
(
new_code2
,
ip
,
faulted
);
if
(
unlikely
(
faulted
))
return
-
EFAULT
;
ip
-=
4
;
old_fs
=
get_fs
();
set_fs
(
get_ds
());
flush_icache_range
(
ip
,
ip
+
8
);
set_fs
(
old_fs
);
return
0
;
}
static
int
ftrace_modify_code_2r
(
unsigned
long
ip
,
unsigned
int
new_code1
,
unsigned
int
new_code2
)
{
int
faulted
;
mm_segment_t
old_fs
;
ip
+=
4
;
safe_store_code
(
new_code2
,
ip
,
faulted
);
if
(
unlikely
(
faulted
))
return
-
EFAULT
;
ip
-=
4
;
safe_store_code
(
new_code1
,
ip
,
faulted
);
if
(
unlikely
(
faulted
))
if
(
unlikely
(
faulted
))
return
-
EFAULT
;
return
-
EFAULT
;
old_fs
=
get_fs
();
set_fs
(
get_ds
());
flush_icache_range
(
ip
,
ip
+
8
);
flush_icache_range
(
ip
,
ip
+
8
);
set_fs
(
old_fs
);
return
0
;
return
0
;
}
}
#endif
#endif
...
@@ -130,13 +163,14 @@ static int ftrace_modify_code_2(unsigned long ip, unsigned int new_code1,
...
@@ -130,13 +163,14 @@ static int ftrace_modify_code_2(unsigned long ip, unsigned int new_code1,
*
*
* move at, ra
* move at, ra
* jal _mcount --> nop
* jal _mcount --> nop
* sub sp, sp, 8 --> nop (CONFIG_32BIT)
*
*
* 2. For modules:
* 2. For modules:
*
*
* 2.1 For KBUILD_MCOUNT_RA_ADDRESS and CONFIG_32BIT
* 2.1 For KBUILD_MCOUNT_RA_ADDRESS and CONFIG_32BIT
*
*
* lui v1, hi_16bit_of_mcount --> b 1f (0x10000005)
* lui v1, hi_16bit_of_mcount --> b 1f (0x10000005)
* addiu v1, v1, low_16bit_of_mcount
* addiu v1, v1, low_16bit_of_mcount
--> nop (CONFIG_32BIT)
* move at, ra
* move at, ra
* move $12, ra_address
* move $12, ra_address
* jalr v1
* jalr v1
...
@@ -145,7 +179,7 @@ static int ftrace_modify_code_2(unsigned long ip, unsigned int new_code1,
...
@@ -145,7 +179,7 @@ static int ftrace_modify_code_2(unsigned long ip, unsigned int new_code1,
* 2.2 For the Other situations
* 2.2 For the Other situations
*
*
* lui v1, hi_16bit_of_mcount --> b 1f (0x10000004)
* lui v1, hi_16bit_of_mcount --> b 1f (0x10000004)
* addiu v1, v1, low_16bit_of_mcount
* addiu v1, v1, low_16bit_of_mcount
--> nop (CONFIG_32BIT)
* move at, ra
* move at, ra
* jalr v1
* jalr v1
* nop | move $12, ra_address | sub sp, sp, 8
* nop | move $12, ra_address | sub sp, sp, 8
...
@@ -184,10 +218,14 @@ int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr)
...
@@ -184,10 +218,14 @@ int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr)
unsigned
int
new
;
unsigned
int
new
;
unsigned
long
ip
=
rec
->
ip
;
unsigned
long
ip
=
rec
->
ip
;
new
=
in_kernel_space
(
ip
)
?
insn_jal_ftrace_caller
:
new
=
in_kernel_space
(
ip
)
?
insn_jal_ftrace_caller
:
insn_la_mcount
[
0
];
insn_lui_v1_hi16_mcount
;
#ifdef CONFIG_64BIT
return
ftrace_modify_code
(
ip
,
new
);
return
ftrace_modify_code
(
ip
,
new
);
#else
return
ftrace_modify_code_2r
(
ip
,
new
,
in_kernel_space
(
ip
)
?
INSN_NOP
:
insn_la_mcount
[
1
]);
#endif
}
}
#define FTRACE_CALL_IP ((unsigned long)(&ftrace_call))
#define FTRACE_CALL_IP ((unsigned long)(&ftrace_call))
...
...
arch/mips/kernel/mcount.S
View file @
475d5928
...
@@ -84,6 +84,19 @@ _mcount:
...
@@ -84,6 +84,19 @@ _mcount:
#endif
#endif
PTR_SUBU
a0
,
ra
,
8
/*
arg1
:
self
address
*/
PTR_SUBU
a0
,
ra
,
8
/*
arg1
:
self
address
*/
PTR_LA
t1
,
_stext
sltu
t2
,
a0
,
t1
/*
t2
=
(
a0
<
_stext
)
*/
PTR_LA
t1
,
_etext
sltu
t3
,
t1
,
a0
/*
t3
=
(
a0
>
_etext
)
*/
or
t1
,
t2
,
t3
beqz
t1
,
ftrace_call
nop
#if defined(KBUILD_MCOUNT_RA_ADDRESS) && defined(CONFIG_32BIT)
PTR_SUBU
a0
,
a0
,
16
/*
arg1
:
adjust
to
module
's recorded callsite */
#else
PTR_SUBU
a0
,
a0
,
12
#endif
.
globl
ftrace_call
.
globl
ftrace_call
ftrace_call
:
ftrace_call
:
nop
/*
a
placeholder
for
the
call
to
a
real
tracing
function
*/
nop
/*
a
placeholder
for
the
call
to
a
real
tracing
function
*/
...
...
arch/mips/kernel/ptrace.c
View file @
475d5928
...
@@ -150,6 +150,7 @@ int ptrace_setfpregs(struct task_struct *child, __u32 __user *data)
...
@@ -150,6 +150,7 @@ int ptrace_setfpregs(struct task_struct *child, __u32 __user *data)
}
}
__get_user
(
child
->
thread
.
fpu
.
fcr31
,
data
+
64
);
__get_user
(
child
->
thread
.
fpu
.
fcr31
,
data
+
64
);
child
->
thread
.
fpu
.
fcr31
&=
~
FPU_CSR_ALL_X
;
/* FIR may not be written. */
/* FIR may not be written. */
...
@@ -695,7 +696,7 @@ long arch_ptrace(struct task_struct *child, long request,
...
@@ -695,7 +696,7 @@ long arch_ptrace(struct task_struct *child, long request,
break
;
break
;
#endif
#endif
case
FPC_CSR
:
case
FPC_CSR
:
child
->
thread
.
fpu
.
fcr31
=
data
;
child
->
thread
.
fpu
.
fcr31
=
data
&
~
FPU_CSR_ALL_X
;
break
;
break
;
case
DSP_BASE
...
DSP_BASE
+
5
:
{
case
DSP_BASE
...
DSP_BASE
+
5
:
{
dspreg_t
*
dregs
;
dspreg_t
*
dregs
;
...
...
arch/mips/kernel/rtlx-cmp.c
View file @
475d5928
...
@@ -77,6 +77,9 @@ int __init rtlx_module_init(void)
...
@@ -77,6 +77,9 @@ int __init rtlx_module_init(void)
dev
=
device_create
(
mt_class
,
NULL
,
MKDEV
(
major
,
i
),
NULL
,
dev
=
device_create
(
mt_class
,
NULL
,
MKDEV
(
major
,
i
),
NULL
,
"%s%d"
,
RTLX_MODULE_NAME
,
i
);
"%s%d"
,
RTLX_MODULE_NAME
,
i
);
if
(
IS_ERR
(
dev
))
{
if
(
IS_ERR
(
dev
))
{
while
(
i
--
)
device_destroy
(
mt_class
,
MKDEV
(
major
,
i
));
err
=
PTR_ERR
(
dev
);
err
=
PTR_ERR
(
dev
);
goto
out_chrdev
;
goto
out_chrdev
;
}
}
...
...
arch/mips/kernel/rtlx-mt.c
View file @
475d5928
...
@@ -103,6 +103,9 @@ int __init rtlx_module_init(void)
...
@@ -103,6 +103,9 @@ int __init rtlx_module_init(void)
dev
=
device_create
(
mt_class
,
NULL
,
MKDEV
(
major
,
i
),
NULL
,
dev
=
device_create
(
mt_class
,
NULL
,
MKDEV
(
major
,
i
),
NULL
,
"%s%d"
,
RTLX_MODULE_NAME
,
i
);
"%s%d"
,
RTLX_MODULE_NAME
,
i
);
if
(
IS_ERR
(
dev
))
{
if
(
IS_ERR
(
dev
))
{
while
(
i
--
)
device_destroy
(
mt_class
,
MKDEV
(
major
,
i
));
err
=
PTR_ERR
(
dev
);
err
=
PTR_ERR
(
dev
);
goto
out_chrdev
;
goto
out_chrdev
;
}
}
...
...
arch/mips/kernel/scall64-n32.S
View file @
475d5928
...
@@ -162,7 +162,7 @@ EXPORT(sysn32_call_table)
...
@@ -162,7 +162,7 @@ EXPORT(sysn32_call_table)
PTR
sys_getpeername
PTR
sys_getpeername
PTR
sys_socketpair
PTR
sys_socketpair
PTR
compat_sys_setsockopt
PTR
compat_sys_setsockopt
PTR
sys_getsockopt
PTR
compat_
sys_getsockopt
PTR
__sys_clone
/*
6055
*/
PTR
__sys_clone
/*
6055
*/
PTR
__sys_fork
PTR
__sys_fork
PTR
compat_sys_execve
PTR
compat_sys_execve
...
...
arch/mips/kernel/smp-mt.c
View file @
475d5928
...
@@ -288,6 +288,7 @@ struct plat_smp_ops vsmp_smp_ops = {
...
@@ -288,6 +288,7 @@ struct plat_smp_ops vsmp_smp_ops = {
.
prepare_cpus
=
vsmp_prepare_cpus
,
.
prepare_cpus
=
vsmp_prepare_cpus
,
};
};
#ifdef CONFIG_PROC_FS
static
int
proc_cpuinfo_chain_call
(
struct
notifier_block
*
nfb
,
static
int
proc_cpuinfo_chain_call
(
struct
notifier_block
*
nfb
,
unsigned
long
action_unused
,
void
*
data
)
unsigned
long
action_unused
,
void
*
data
)
{
{
...
@@ -309,3 +310,4 @@ static int __init proc_cpuinfo_notifier_init(void)
...
@@ -309,3 +310,4 @@ static int __init proc_cpuinfo_notifier_init(void)
}
}
subsys_initcall
(
proc_cpuinfo_notifier_init
);
subsys_initcall
(
proc_cpuinfo_notifier_init
);
#endif
arch/mips/kernel/unaligned.c
View file @
475d5928
...
@@ -690,7 +690,6 @@ static void emulate_load_store_insn(struct pt_regs *regs,
...
@@ -690,7 +690,6 @@ static void emulate_load_store_insn(struct pt_regs *regs,
case
sdc1_op
:
case
sdc1_op
:
die_if_kernel
(
"Unaligned FP access in kernel code"
,
regs
);
die_if_kernel
(
"Unaligned FP access in kernel code"
,
regs
);
BUG_ON
(
!
used_math
());
BUG_ON
(
!
used_math
());
BUG_ON
(
!
is_fpu_owner
());
lose_fpu
(
1
);
/* Save FPU state for the emulator. */
lose_fpu
(
1
);
/* Save FPU state for the emulator. */
res
=
fpu_emulator_cop1Handler
(
regs
,
&
current
->
thread
.
fpu
,
1
,
res
=
fpu_emulator_cop1Handler
(
regs
,
&
current
->
thread
.
fpu
,
1
,
...
...
arch/mips/math-emu/cp1emu.c
View file @
475d5928
...
@@ -1827,7 +1827,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
...
@@ -1827,7 +1827,7 @@ static int fpu_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
case
-
1
:
case
-
1
:
if
(
cpu_has_mips_4_5_r
)
if
(
cpu_has_mips_4_5_r
)
cbit
=
fpucondbit
[
MIPSInst_
RT
(
ir
)
>>
2
];
cbit
=
fpucondbit
[
MIPSInst_
FD
(
ir
)
>>
2
];
else
else
cbit
=
FPU_CSR_COND
;
cbit
=
FPU_CSR_COND
;
if
(
rv
.
w
)
if
(
rv
.
w
)
...
...
arch/mips/mm/tlbex.c
View file @
475d5928
...
@@ -429,6 +429,7 @@ static void build_r3000_tlb_refill_handler(void)
...
@@ -429,6 +429,7 @@ static void build_r3000_tlb_refill_handler(void)
(
unsigned
int
)(
p
-
tlb_handler
));
(
unsigned
int
)(
p
-
tlb_handler
));
memcpy
((
void
*
)
ebase
,
tlb_handler
,
0x80
);
memcpy
((
void
*
)
ebase
,
tlb_handler
,
0x80
);
local_flush_icache_range
(
ebase
,
ebase
+
0x80
);
dump_handler
(
"r3000_tlb_refill"
,
(
u32
*
)
ebase
,
32
);
dump_handler
(
"r3000_tlb_refill"
,
(
u32
*
)
ebase
,
32
);
}
}
...
@@ -1299,6 +1300,7 @@ static void build_r4000_tlb_refill_handler(void)
...
@@ -1299,6 +1300,7 @@ static void build_r4000_tlb_refill_handler(void)
}
}
#ifdef CONFIG_MIPS_HUGE_TLB_SUPPORT
#ifdef CONFIG_MIPS_HUGE_TLB_SUPPORT
uasm_l_tlb_huge_update
(
&
l
,
p
);
uasm_l_tlb_huge_update
(
&
l
,
p
);
UASM_i_LW
(
&
p
,
K0
,
0
,
K1
);
build_huge_update_entries
(
&
p
,
htlb_info
.
huge_pte
,
K1
);
build_huge_update_entries
(
&
p
,
htlb_info
.
huge_pte
,
K1
);
build_huge_tlb_write_entry
(
&
p
,
&
l
,
&
r
,
K0
,
tlb_random
,
build_huge_tlb_write_entry
(
&
p
,
&
l
,
&
r
,
K0
,
tlb_random
,
htlb_info
.
restore_scratch
);
htlb_info
.
restore_scratch
);
...
@@ -1415,6 +1417,7 @@ static void build_r4000_tlb_refill_handler(void)
...
@@ -1415,6 +1417,7 @@ static void build_r4000_tlb_refill_handler(void)
final_len
);
final_len
);
memcpy
((
void
*
)
ebase
,
final_handler
,
0x100
);
memcpy
((
void
*
)
ebase
,
final_handler
,
0x100
);
local_flush_icache_range
(
ebase
,
ebase
+
0x100
);
dump_handler
(
"r4000_tlb_refill"
,
(
u32
*
)
ebase
,
64
);
dump_handler
(
"r4000_tlb_refill"
,
(
u32
*
)
ebase
,
64
);
}
}
...
...
arch/mips/rb532/devices.c
View file @
475d5928
...
@@ -223,6 +223,7 @@ static struct platform_device rb532_wdt = {
...
@@ -223,6 +223,7 @@ static struct platform_device rb532_wdt = {
static
struct
plat_serial8250_port
rb532_uart_res
[]
=
{
static
struct
plat_serial8250_port
rb532_uart_res
[]
=
{
{
{
.
type
=
PORT_16550A
,
.
membase
=
(
char
*
)
KSEG1ADDR
(
REGBASE
+
UART0BASE
),
.
membase
=
(
char
*
)
KSEG1ADDR
(
REGBASE
+
UART0BASE
),
.
irq
=
UART0_IRQ
,
.
irq
=
UART0_IRQ
,
.
regshift
=
2
,
.
regshift
=
2
,
...
...
arch/mips/sgi-ip22/ip22-gio.c
View file @
475d5928
...
@@ -27,8 +27,14 @@ static struct {
...
@@ -27,8 +27,14 @@ static struct {
{
.
name
=
"SGI GR2/GR3"
,
.
id
=
0x7f
},
{
.
name
=
"SGI GR2/GR3"
,
.
id
=
0x7f
},
};
};
static
void
gio_bus_release
(
struct
device
*
dev
)
{
kfree
(
dev
);
}
static
struct
device
gio_bus
=
{
static
struct
device
gio_bus
=
{
.
init_name
=
"gio"
,
.
init_name
=
"gio"
,
.
release
=
&
gio_bus_release
,
};
};
/**
/**
...
@@ -413,8 +419,10 @@ int __init ip22_gio_init(void)
...
@@ -413,8 +419,10 @@ int __init ip22_gio_init(void)
int
ret
;
int
ret
;
ret
=
device_register
(
&
gio_bus
);
ret
=
device_register
(
&
gio_bus
);
if
(
ret
)
if
(
ret
)
{
put_device
(
&
gio_bus
);
return
ret
;
return
ret
;
}
ret
=
bus_register
(
&
gio_bus_type
);
ret
=
bus_register
(
&
gio_bus_type
);
if
(
!
ret
)
{
if
(
!
ret
)
{
...
...
arch/mips/txx9/generic/7segled.c
View file @
475d5928
...
@@ -83,6 +83,11 @@ static struct bus_type tx_7segled_subsys = {
...
@@ -83,6 +83,11 @@ static struct bus_type tx_7segled_subsys = {
.
dev_name
=
"7segled"
,
.
dev_name
=
"7segled"
,
};
};
static
void
tx_7segled_release
(
struct
device
*
dev
)
{
kfree
(
dev
);
}
static
int
__init
tx_7segled_init_sysfs
(
void
)
static
int
__init
tx_7segled_init_sysfs
(
void
)
{
{
int
error
,
i
;
int
error
,
i
;
...
@@ -103,12 +108,15 @@ static int __init tx_7segled_init_sysfs(void)
...
@@ -103,12 +108,15 @@ static int __init tx_7segled_init_sysfs(void)
}
}
dev
->
id
=
i
;
dev
->
id
=
i
;
dev
->
bus
=
&
tx_7segled_subsys
;
dev
->
bus
=
&
tx_7segled_subsys
;
dev
->
release
=
&
tx_7segled_release
;
error
=
device_register
(
dev
);
error
=
device_register
(
dev
);
if
(
!
error
)
{
if
(
error
)
{
put_device
(
dev
);
return
error
;
}
device_create_file
(
dev
,
&
dev_attr_ascii
);
device_create_file
(
dev
,
&
dev_attr_ascii
);
device_create_file
(
dev
,
&
dev_attr_raw
);
device_create_file
(
dev
,
&
dev_attr_raw
);
}
}
}
return
error
;
return
error
;
}
}
...
...
arch/mips/txx9/generic/setup.c
View file @
475d5928
...
@@ -937,6 +937,14 @@ static ssize_t txx9_sram_write(struct file *filp, struct kobject *kobj,
...
@@ -937,6 +937,14 @@ static ssize_t txx9_sram_write(struct file *filp, struct kobject *kobj,
return
size
;
return
size
;
}
}
static
void
txx9_device_release
(
struct
device
*
dev
)
{
struct
txx9_sramc_dev
*
tdev
;
tdev
=
container_of
(
dev
,
struct
txx9_sramc_dev
,
dev
);
kfree
(
tdev
);
}
void
__init
txx9_sramc_init
(
struct
resource
*
r
)
void
__init
txx9_sramc_init
(
struct
resource
*
r
)
{
{
struct
txx9_sramc_dev
*
dev
;
struct
txx9_sramc_dev
*
dev
;
...
@@ -951,8 +959,11 @@ void __init txx9_sramc_init(struct resource *r)
...
@@ -951,8 +959,11 @@ void __init txx9_sramc_init(struct resource *r)
return
;
return
;
size
=
resource_size
(
r
);
size
=
resource_size
(
r
);
dev
->
base
=
ioremap
(
r
->
start
,
size
);
dev
->
base
=
ioremap
(
r
->
start
,
size
);
if
(
!
dev
->
base
)
if
(
!
dev
->
base
)
{
goto
exit
;
kfree
(
dev
);
return
;
}
dev
->
dev
.
release
=
&
txx9_device_release
;
dev
->
dev
.
bus
=
&
txx9_sramc_subsys
;
dev
->
dev
.
bus
=
&
txx9_sramc_subsys
;
sysfs_bin_attr_init
(
&
dev
->
bindata_attr
);
sysfs_bin_attr_init
(
&
dev
->
bindata_attr
);
dev
->
bindata_attr
.
attr
.
name
=
"bindata"
;
dev
->
bindata_attr
.
attr
.
name
=
"bindata"
;
...
@@ -963,17 +974,15 @@ void __init txx9_sramc_init(struct resource *r)
...
@@ -963,17 +974,15 @@ void __init txx9_sramc_init(struct resource *r)
dev
->
bindata_attr
.
private
=
dev
;
dev
->
bindata_attr
.
private
=
dev
;
err
=
device_register
(
&
dev
->
dev
);
err
=
device_register
(
&
dev
->
dev
);
if
(
err
)
if
(
err
)
goto
exit
;
goto
exit
_put
;
err
=
sysfs_create_bin_file
(
&
dev
->
dev
.
kobj
,
&
dev
->
bindata_attr
);
err
=
sysfs_create_bin_file
(
&
dev
->
dev
.
kobj
,
&
dev
->
bindata_attr
);
if
(
err
)
{
if
(
err
)
{
device_unregister
(
&
dev
->
dev
);
device_unregister
(
&
dev
->
dev
);
goto
exit
;
}
return
;
exit:
if
(
dev
)
{
if
(
dev
->
base
)
iounmap
(
dev
->
base
);
iounmap
(
dev
->
base
);
kfree
(
dev
);
kfree
(
dev
);
}
}
return
;
exit_put:
put_device
(
&
dev
->
dev
);
return
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment