I decided in retirement to fill the gaps in my education, so now I reading book"Linux Device Drivers Development" and noticed lots of annoying typos in code samples
page 65:
page 103-104:
An so on. Seems that code samples looks like Frankenstein ripped from some random kernel places
page 65:
/* some where */
spinlock_t my_spinlock;
spin_lock_init(my_spinlock);
static irqreturn_t my_irq_handler(int irq, void *data)
{
unsigned long status, flags;
spin_lock_irqsave(&my_spinlock, flags);
status = access_shared_resources();
spin_unlock_irqrestore(&gpio->slock, flags); // wut? &
my_spinlock
return IRQ_HANDLED;
}
page 103-104:
struct my_data {
int my_int_var;
struct tasklet_struct the_tasklet;
int dma_request;
};
static irqreturn_t my_irq_handler(int irq, void *dev_id)
{
struct my_data *md = dev_id;
/* Let's schedule our tasklet */
tasklet_schedule(&md.dma_tasklet); // wut? &md->
the_tasklet
return IRQ_HANDLED;
}
An so on. Seems that code samples looks like Frankenstein ripped from some random kernel places