Messages in this thread | | | Date | Thu, 1 Apr 2010 10:20:05 +0100 | From | Alan Cox <> | Subject | Re: [PATCH] drivers:staging: sources for ST core |
| |
> +/* > + * function to return whether the firmware response was proper > + * in case of error don't complete so that waiting for proper > + * response times out > + */ > +void validate_firmware_response(struct sk_buff *skb) > +{ > + if (unlikely(skb->data[5] != 0)) { > + pr_err("no proper response during fw download"); > + pr_err("data6 %x", skb->data[5]);
In this driver you do know the device so you need to be using dev_ and passing around dev (or something that gives you dev).
> +static int kim_probe(struct platform_device *pdev) > +{ > + long status; > + long proto; > + long *gpios = pdev->dev.platform_data; > + > + status = st_core_init(&kim_gdata->core_data);
I would expect any truely global data to be configured in the module init and then device specific data you want to do something like this
kim_data = kzalloc(sizeof(something), GFP_KERNEL);
..
kim_data_init(&pdev->dev, kim_data); dev_set_drvdata(&pdev->dev, kim_data);
Elsewhere you can now do
kim_data = dev_get_drvdata(&pdev->dev);
to get it back
| |