All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Boyd <sboyd@codeaurora.org>
To: David Brown <davidb@codeaurora.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Grant Likely <grant.likely@secretlab.ca>,
	Rob Herring <rob.herring@calxeda.com>,
	Rob Landley <rob@landley.net>,
	Russell King <linux@arm.linux.org.uk>,
	Daniel Walker <dwalker@fifo99.com>,
	Bryan Huntsman <bryanh@codeaurora.org>,
	linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org
Subject: Re: [PATCH v2 05/11] SSBI: Convert SSBI to device tree
Date: Tue, 12 Mar 2013 13:46:28 -0700	[thread overview]
Message-ID: <513F9424.8020902@codeaurora.org> (raw)
In-Reply-To: <1363113716-25897-6-git-send-email-davidb@codeaurora.org>

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

WARNING: multiple messages have this Message-ID (diff)
From: sboyd@codeaurora.org (Stephen Boyd)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2 05/11] SSBI: Convert SSBI to device tree
Date: Tue, 12 Mar 2013 13:46:28 -0700	[thread overview]
Message-ID: <513F9424.8020902@codeaurora.org> (raw)
In-Reply-To: <1363113716-25897-6-git-send-email-davidb@codeaurora.org>

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

  reply	other threads:[~2013-03-12 20:46 UTC|newest]

Thread overview: 74+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-07  0:29 [PATCH 0/6] Qualcomm SSBI bus driver David Brown
2013-03-07  0:29 ` David Brown
2013-03-07  0:29 ` [PATCH 1/6] platform-drivers: msm: add single-wire serial bus interface (SSBI) driver David Brown
2013-03-07  0:29   ` David Brown
2013-03-07  1:30   ` Greg Kroah-Hartman
2013-03-07  1:30     ` Greg Kroah-Hartman
2013-03-07  5:20     ` David Brown
2013-03-07  5:20       ` David Brown
2013-03-07  6:01       ` Greg Kroah-Hartman
2013-03-07  6:01         ` Greg Kroah-Hartman
2013-03-07 10:05         ` Sekhar Nori
2013-03-07 10:05           ` Sekhar Nori
2013-03-07 10:05           ` Sekhar Nori
2013-03-07 18:45           ` David Brown
2013-03-07 18:45             ` David Brown
2013-03-07 18:45             ` David Brown
2013-03-07 18:50         ` David Brown
2013-03-07 18:50           ` David Brown
2013-03-07 23:29           ` Greg Kroah-Hartman
2013-03-07 23:29             ` Greg Kroah-Hartman
2013-03-12  6:51     ` David Brown
2013-03-12  6:51       ` David Brown
2013-03-12 13:27       ` Greg Kroah-Hartman
2013-03-12 13:27         ` Greg Kroah-Hartman
2013-03-07  0:29 ` [PATCH 2/6] SSBI: Convert SSBI to device tree David Brown
2013-03-07  0:29   ` David Brown
2013-03-07  0:29   ` David Brown
2013-03-07  0:29 ` [PATCH 3/6] ssbi: Fix exit mismatch in remove function David Brown
2013-03-07  0:29   ` David Brown
2013-03-07  1:30   ` Greg Kroah-Hartman
2013-03-07  1:30     ` Greg Kroah-Hartman
2013-03-07  5:21     ` David Brown
2013-03-07  5:21       ` David Brown
2013-03-07  0:29 ` [PATCH 4/6] ssbi: Use regular init level David Brown
2013-03-07  0:29   ` David Brown
2013-03-07  0:29 ` [PATCH 5/6] ARM: msm: enable SSBI driver in defconfig David Brown
2013-03-07  0:29   ` David Brown
2013-03-07  0:29   ` David Brown
2013-03-07  0:29 ` [PATCH 6/6] RFC: SSBI: Simple pm8058 test driver David Brown
2013-03-07  0:29   ` David Brown
2013-03-12 18:41 ` [PATCH v2 0/11] Qualcomm SSBI bus driver David Brown
2013-03-12 18:41   ` David Brown
2013-03-12 18:41   ` [PATCH v2 01/11] platform-drivers: msm: add single-wire serial bus interface (SSBI) driver David Brown
2013-03-12 18:41     ` David Brown
2013-03-12 18:41   ` [PATCH v2 02/11] fix: Use EXPORT_SYMBOL_GPL David Brown
2013-03-12 18:41     ` David Brown
2013-03-12 18:41     ` David Brown
2013-03-12 18:41   ` [PATCH v2 03/11] ssbi: Fix exit mismatch in remove function David Brown
2013-03-12 18:41     ` David Brown
2013-03-12 18:41     ` David Brown
2013-03-12 18:41   ` [PATCH v2 04/11] ssbi: Allow compilation as a module David Brown
2013-03-12 18:41     ` David Brown
2013-03-12 18:41   ` [PATCH v2 05/11] SSBI: Convert SSBI to device tree David Brown
2013-03-12 18:41     ` David Brown
2013-03-12 20:46     ` Stephen Boyd [this message]
2013-03-12 20:46       ` Stephen Boyd
2013-03-12 18:41   ` [PATCH v2 06/11] ssbi: Comment the use of udelay() David Brown
2013-03-12 18:41     ` David Brown
2013-03-12 18:41   ` [PATCH v2 07/11] ssbi: Use regular init level David Brown
2013-03-12 18:41     ` David Brown
2013-03-12 18:41     ` David Brown
2013-03-12 20:26     ` Stephen Boyd
2013-03-12 20:26       ` Stephen Boyd
2013-03-12 18:41   ` [PATCH v2 08/11] ssbi: Remove extraneous logging David Brown
2013-03-12 18:41     ` David Brown
2013-03-12 18:41   ` [PATCH v2 09/11] SSBI: Remove MSM_ prefix from SSBI drivers David Brown
2013-03-12 18:41     ` David Brown
2013-03-12 18:41   ` [PATCH v2 10/11] MAINTAINERS: add ssbi David Brown
2013-03-12 18:41     ` David Brown
2013-03-12 18:41     ` David Brown
2013-03-25 17:40   ` [PATCH v2 0/11] Qualcomm SSBI bus driver Greg Kroah-Hartman
2013-03-25 17:40     ` Greg Kroah-Hartman
2013-03-12 20:12 ` [PATCH v2 11/11] RFC: SSBI: Simple pm8058 test driver David Brown
2013-03-12 20:12   ` David Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=513F9424.8020902@codeaurora.org \
    --to=sboyd@codeaurora.org \
    --cc=bryanh@codeaurora.org \
    --cc=davidb@codeaurora.org \
    --cc=dwalker@fifo99.com \
    --cc=grant.likely@secretlab.ca \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=rob.herring@calxeda.com \
    --cc=rob@landley.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.