of: add helper function to retrive match data
authorJoachim Eastwood <manabian@gmail.com>
Wed, 6 May 2015 18:09:09 +0000 (20:09 +0200)
committerRob Herring <robh@kernel.org>
Thu, 28 May 2015 17:59:40 +0000 (12:59 -0500)
commit3386e0fa905c31bf1dafa2cbe2ecceb7e5ce2e66
tree7096ea89f1d2e5aa2366cf85b548d1c53284ed38
parent31712c98f8180c7bd3f33eefa461f0e1142e18f5
of: add helper function to retrive match data

It's a common operation for device drivers to retrive the data
member from of_device_id struct in their probe function.

Most driver end up doing:
    const struct of_device_id *match;
    match = of_match_device(driver_of_match, &pdev->dev);
    driver->data = match->data;

With the of_device_get_match_data helper function all this can
done in one go.

Signed-off-by: Joachim Eastwood <manabian@gmail.com>
[robh: add missing inline to dummmy declaration]
Signed-off-by: Rob Herring <robh@kernel.org>
drivers/of/device.c
include/linux/of_device.h
This page took 0.025255 seconds and 5 git commands to generate.