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] [thread-next>] [day] [month] [year] [list]
Message-ID: <513F9424.8020902@codeaurora.org>
Date:	Tue, 12 Mar 2013 13:46:28 -0700
From:	Stephen Boyd <sboyd@...eaurora.org>
To:	David Brown <davidb@...eaurora.org>
CC:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Grant Likely <grant.likely@...retlab.ca>,
	Rob Herring <rob.herring@...xeda.com>,
	Rob Landley <rob@...dley.net>,
	Russell King <linux@....linux.org.uk>,
	Daniel Walker <dwalker@...o99.com>,
	Bryan Huntsman <bryanh@...eaurora.org>,
	linux-kernel@...r.kernel.org, linux-arm-msm@...r.kernel.org,
	linux-arm-kernel@...ts.infradead.org, linux-doc@...r.kernel.org
Subject: Re: [PATCH v2 05/11] SSBI: Convert SSBI to device tree

On 03/12/13 11:41, David Brown wrote:
> @@ -261,56 +263,13 @@ int msm_ssbi_write(struct device *dev, u16 addr, u8 *buf, int len)
>  }
>  EXPORT_SYMBOL_GPL(msm_ssbi_write);
>  
> -static int msm_ssbi_add_slave(struct msm_ssbi *ssbi,
> -				const struct msm_ssbi_slave_info *slave)
> -{
> -	struct platform_device *slave_pdev;
> -	int ret;
> -
> -	if (ssbi->slave) {
> -		pr_err("slave already attached??\n");
> -		return -EBUSY;
> -	}
> -
> -	slave_pdev = platform_device_alloc(slave->name, -1);
> -	if (!slave_pdev) {
> -		pr_err("cannot allocate pdev for slave '%s'", slave->name);
> -		ret = -ENOMEM;
> -		goto err;
> -	}
> -
> -	slave_pdev->dev.parent = ssbi->dev;
> -	slave_pdev->dev.platform_data = slave->platform_data;
> -
> -	ret = platform_device_add(slave_pdev);
> -	if (ret) {
> -		pr_err("cannot add slave platform device for '%s'\n",
> -				slave->name);
> -		goto err;
> -	}
> -
> -	ssbi->slave = &slave_pdev->dev;
> -	return 0;
> -
> -err:
> -	if (slave_pdev)
> -		platform_device_put(slave_pdev);
> -	return ret;
> -}
> -
>  static int msm_ssbi_probe(struct platform_device *pdev)
>  {
> -	const struct msm_ssbi_platform_data *pdata = pdev->dev.platform_data;

Now that all this code is gone do we have a user of the
msm_ssbi_platform_data struct? Why not remove it from the header file?
If you remove it from the header you can probably move the enum for
controller_type into this file too.

> @@ -334,7 +293,25 @@ static int msm_ssbi_probe(struct platform_device *pdev)
>  	ssbi->dev = &pdev->dev;
>  	platform_set_drvdata(pdev, ssbi);
>  
> -	ssbi->controller_type = pdata->controller_type;
> +	type = of_get_property(np, "qcom,controller-type", NULL);
> +	if (type == NULL) {
> +		pr_err("Missing qcom,controller-type property\n");

This could be dev_err() considering you use dev_info() below.
> +		ret = -EINVAL;
> +		goto err_ssbi_controller;
> +	}
> +	dev_info(&pdev->dev, "SSBI controller type: '%s'\n", type);
> +	if (strcmp(type, "ssbi") == 0)
> +		ssbi->controller_type = MSM_SBI_CTRL_SSBI;
> +	else if (strcmp(type, "ssbi2") == 0)
> +		ssbi->controller_type = MSM_SBI_CTRL_SSBI2;
> +	else if (strcmp(type, "pmic-arbiter") == 0)
> +		ssbi->controller_type = MSM_SBI_CTRL_PMIC_ARBITER;
> +	else {
> +		pr_err("Unknown qcom,controller-type\n");

dev_err()?

> @@ -370,12 +347,18 @@ static int msm_ssbi_remove(struct platform_device *pdev)
>  	return 0;
>  }
>  
> +static struct of_device_id ssbi_match_table[] = {

const?

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum,
hosted by The Linux Foundation

--
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