@@ -40,6 +40,7 @@ struct PL061DataInner {
40
40
}
41
41
42
42
struct PL061Data {
43
+ dev : device:: Device ,
43
44
inner : SpinLock < PL061DataInner > ,
44
45
}
45
46
@@ -148,7 +149,8 @@ impl irq::Chip for PL061Device {
148
149
if trigger & ( irq:: Type :: LEVEL_HIGH | irq:: Type :: LEVEL_LOW ) != 0
149
150
&& trigger & ( irq:: Type :: EDGE_RISING | irq:: Type :: EDGE_FALLING ) != 0
150
151
{
151
- pr_err ! (
152
+ dev_err ! (
153
+ data. dev,
152
154
"trying to configure line {} for both level and edge detection, choose one!\n " ,
153
155
offset
154
156
) ;
@@ -176,7 +178,8 @@ impl irq::Chip for PL061Device {
176
178
gpioiev &= !bit;
177
179
}
178
180
irq_data. set_level_handler ( ) ;
179
- pr_debug ! (
181
+ dev_dbg ! (
182
+ data. dev,
180
183
"line {}: IRQ on {} level\n " ,
181
184
offset,
182
185
if polarity { "HIGH" } else { "LOW" }
@@ -187,7 +190,7 @@ impl irq::Chip for PL061Device {
187
190
// Select both edges, settings this makes GPIOEV be ignored.
188
191
gpioibe |= bit;
189
192
irq_data. set_edge_handler ( ) ;
190
- pr_debug ! ( "line {}: IRQ on both edges\n " , offset) ;
193
+ dev_dbg ! ( data . dev , "line {}: IRQ on both edges\n " , offset) ;
191
194
} else if trigger & ( irq:: Type :: EDGE_RISING | irq:: Type :: EDGE_FALLING ) != 0 {
192
195
let rising = trigger & irq:: Type :: EDGE_RISING != 0 ;
193
196
@@ -202,7 +205,8 @@ impl irq::Chip for PL061Device {
202
205
gpioiev &= !bit;
203
206
}
204
207
irq_data. set_edge_handler ( ) ;
205
- pr_debug ! (
208
+ dev_dbg ! (
209
+ data. dev,
206
210
"line {}: IRQ on {} edge\n " ,
207
211
offset,
208
212
if rising { "RISING" } else { "FALLING}" }
@@ -213,7 +217,7 @@ impl irq::Chip for PL061Device {
213
217
gpioibe &= !bit;
214
218
gpioiev &= !bit;
215
219
irq_data. set_bad_handler ( ) ;
216
- pr_warn ! ( "no trigger selected for line {}\n " , offset) ;
220
+ dev_warn ! ( data . dev , "no trigger selected for line {}\n " , offset) ;
217
221
}
218
222
219
223
pl061. base . writeb ( gpiois, GPIOIS ) ;
@@ -278,6 +282,7 @@ impl amba::Driver for PL061Device {
278
282
parent_irq: irq,
279
283
} ,
280
284
PL061Data {
285
+ dev: device:: Device :: from_dev( dev) ,
281
286
// SAFETY: We call `spinlock_init` below.
282
287
inner: unsafe { SpinLock :: new( PL061DataInner :: default ( ) ) } ,
283
288
} ,
@@ -297,7 +302,7 @@ impl amba::Driver for PL061Device {
297
302
. as_pinned_mut ( )
298
303
. register :: < Self > ( PL061_GPIO_NR , None , dev, data. clone ( ) , irq) ?;
299
304
300
- pr_info ! ( "PL061 GPIO chip registered\n " ) ;
305
+ dev_info ! ( data . dev , "PL061 GPIO chip registered\n " ) ;
301
306
302
307
Ok ( data)
303
308
}
0 commit comments