lkml.org 
[lkml]   [2010]   [Apr]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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


\
 
 \ /
  Last update: 2010-04-01 11:19    [W:4.975 / U:0.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site