linux - Where the probe() function's argument comes from? -


i'm studying linux device driver. currently, understand flows of device driver approximatively, dont know how probe() function gets arguments.

for example, here code , based on kernel 3.10.

static int gpio_led_probe(struct platform_device *pdev) {        struct gpio_led_platform_data *pdata = pdev->dev.platform_data;        struct gpio_leds_priv *priv;        ....        priv = gpio_leds_create_of(pdev);        .... } 

as this, argument 'pdev' using various point of source. i'm understading when probe() called , it's role, cannot find data 'pdev' comes from.

thanks read thread, , sorry english not good.

platform device specific data while probing comes platform setup code or device tree. can find related code in arch/arm/borad/device files struct platform_device embedded platform_data structure pass platform related data drivers.

in modern kernels platform data passed device drivers through device tree. device tree can found in /arch/arm/boot/dts/your_device


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -