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