What does request_mem_region() actually do and when it is needed?

后端 未结 2 414
小鲜肉
小鲜肉 2020-12-01 04:21

I\'m studying on writing embedded linux driver, and decided to fire a few GPIOs to make sure I understand the book (LDD3, chap9.4.1) correctly.

I am able to control

2条回答
  •  孤独总比滥情好
    2020-12-01 05:16

    Using request_mem_region() and ioremap() in device drivers is now deprecated. You should use the below "managed" functions instead, which simplify driver coding and error handling:

    devm_ioremap()
    devm_iounmap()
    devm_ioremap_resource(), Takes care of both the request and remapping operations
    

    https://bootlin.com/doc/training/linux-kernel/linux-kernel-slides.pdf slide 276

提交回复
热议问题