lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Thu, 1 Apr 2010 10:20:05 +0100
From:	Alan Cox <alan@...rguk.ukuu.org.uk>
To:	pavan_savoy@...com
Cc:	Greg KH <gregkh@...e.de>, Marcel Holtmann <marcel@...tmann.org>,
	linux-kernel@...r.kernel.org
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ