public inbox for linux-next@vger.kernel.org 
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb•auug.org.au>
To: Eduardo Valentin <edubezval@gmail•com>
Cc: Linux Next Mailing List <linux-next@vger•kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger•kernel.org>,
	Guenter Roeck <linux@roeck-us•net>,
	Stefan Wahren <stefan.wahren@i2se•com>,
	Robin Murphy <robin.murphy@arm•com>
Subject: linux-next: manual merge of the thermal-soc tree with Linus' tree
Date: Wed, 15 May 2019 10:05:12 +1000	[thread overview]
Message-ID: <20190515100512.24b80412@canb.auug.org.au> (raw)

[-- Attachment #1: Type: text/plain, Size: 5120 bytes --]

Hi all,

Today's linux-next merge of the thermal-soc tree got a conflict in:

  drivers/hwmon/pwm-fan.c

between commits:

  6b1ec4789fb1 ("hwmon: (pwm-fan) Add RPM support via external interrupt")
  841cf6767bf6 ("hwmon: (pwm-fan) Report probe errors consistently")

from Linus' tree and commit:

  37bcec5d9f71 ("hwmon: (pwm-fan) Use devm_thermal_of_cooling_device_register")

from the thermal-soc tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging.  You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

-- 
Cheers,
Stephen Rothwell

diff --cc drivers/hwmon/pwm-fan.c
index eead8afe6447,0243ba70107e..000000000000
--- a/drivers/hwmon/pwm-fan.c
+++ b/drivers/hwmon/pwm-fan.c
@@@ -280,9 -225,8 +291,9 @@@ static int pwm_fan_probe(struct platfor
  	struct device *hwmon;
  	int ret;
  	struct pwm_state state = { };
 +	u32 ppr = 2;
  
- 	ctx = devm_kzalloc(&pdev->dev, sizeof(*ctx), GFP_KERNEL);
+ 	ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
  	if (!ctx)
  		return -ENOMEM;
  
@@@ -300,11 -244,7 +311,11 @@@
  
  	platform_set_drvdata(pdev, ctx);
  
 +	ctx->irq = platform_get_irq(pdev, 0);
 +	if (ctx->irq == -EPROBE_DEFER)
 +		return ctx->irq;
 +
- 	ctx->reg_en = devm_regulator_get_optional(&pdev->dev, "fan");
+ 	ctx->reg_en = devm_regulator_get_optional(dev, "fan");
  	if (IS_ERR(ctx->reg_en)) {
  		if (PTR_ERR(ctx->reg_en) != -ENODEV)
  			return PTR_ERR(ctx->reg_en);
@@@ -328,93 -269,38 +340,66 @@@
  
  	ret = pwm_apply_state(ctx->pwm, &state);
  	if (ret) {
- 		dev_err(&pdev->dev, "Failed to configure PWM: %d\n", ret);
- 		goto err_reg_disable;
 -		dev_err(dev, "Failed to configure PWM\n");
++		dev_err(dev, "Failed to configure PWM: %d\n", ret);
+ 		return ret;
  	}
+ 	devm_add_action_or_reset(dev, pwm_fan_pwm_disable, ctx->pwm);
  
 +	timer_setup(&ctx->rpm_timer, sample_timer, 0);
 +
- 	of_property_read_u32(pdev->dev.of_node, "pulses-per-revolution", &ppr);
++	of_property_read_u32(dev->of_node, "pulses-per-revolution", &ppr);
 +	ctx->pulses_per_revolution = ppr;
 +	if (!ctx->pulses_per_revolution) {
- 		dev_err(&pdev->dev, "pulses-per-revolution can't be zero.\n");
++		dev_err(dev, "pulses-per-revolution can't be zero.\n");
 +		ret = -EINVAL;
- 		goto err_pwm_disable;
++		return ret;
 +	}
 +
 +	if (ctx->irq > 0) {
- 		ret = devm_request_irq(&pdev->dev, ctx->irq, pulse_handler, 0,
++		ret = devm_request_irq(dev, ctx->irq, pulse_handler, 0,
 +				       pdev->name, ctx);
 +		if (ret) {
- 			dev_err(&pdev->dev,
- 				"Failed to request interrupt: %d\n", ret);
- 			goto err_pwm_disable;
++			dev_err(dev, "Failed to request interrupt: %d\n", ret);
++			return ret;
 +		}
 +		ctx->sample_start = ktime_get();
 +		mod_timer(&ctx->rpm_timer, jiffies + HZ);
 +	}
 +
- 	hwmon = devm_hwmon_device_register_with_groups(&pdev->dev, "pwmfan",
+ 	hwmon = devm_hwmon_device_register_with_groups(dev, "pwmfan",
  						       ctx, pwm_fan_groups);
  	if (IS_ERR(hwmon)) {
 -		dev_err(dev, "Failed to register hwmon device\n");
 -		return PTR_ERR(hwmon);
 +		ret = PTR_ERR(hwmon);
- 		dev_err(&pdev->dev,
- 			"Failed to register hwmon device: %d\n", ret);
++		dev_err(dev, "Failed to register hwmon device: %d\n", ret);
 +		goto err_del_timer;
  	}
  
- 	ret = pwm_fan_of_get_cooling_data(&pdev->dev, ctx);
+ 	ret = pwm_fan_of_get_cooling_data(dev, ctx);
  	if (ret)
 -		return ret;
 +		goto err_del_timer;
  
  	ctx->pwm_fan_state = ctx->pwm_fan_max_state;
  	if (IS_ENABLED(CONFIG_THERMAL)) {
- 		cdev = thermal_of_cooling_device_register(pdev->dev.of_node,
- 							  "pwm-fan", ctx,
- 							  &pwm_fan_cooling_ops);
+ 		cdev = devm_thermal_of_cooling_device_register(dev,
+ 			dev->of_node, "pwm-fan", ctx, &pwm_fan_cooling_ops);
  		if (IS_ERR(cdev)) {
 +			ret = PTR_ERR(cdev);
- 			dev_err(&pdev->dev,
+ 			dev_err(dev,
 -				"Failed to register pwm-fan as cooling device");
 -			return PTR_ERR(cdev);
 +				"Failed to register pwm-fan as cooling device: %d\n",
 +				ret);
 +			goto err_del_timer;
  		}
  		ctx->cdev = cdev;
  		thermal_cdev_update(cdev);
  	}
  
  	return 0;
 +
 +err_del_timer:
 +	del_timer_sync(&ctx->rpm_timer);
- 
- err_pwm_disable:
- 	state.enabled = false;
- 	pwm_apply_state(ctx->pwm, &state);
- 
- err_reg_disable:
- 	if (ctx->reg_en)
- 		regulator_disable(ctx->reg_en);
- 
 +	return ret;
  }
  
- static int pwm_fan_remove(struct platform_device *pdev)
- {
- 	struct pwm_fan_ctx *ctx = platform_get_drvdata(pdev);
- 
- 	thermal_cooling_device_unregister(ctx->cdev);
- 	del_timer_sync(&ctx->rpm_timer);
- 
- 	if (ctx->pwm_value)
- 		pwm_disable(ctx->pwm);
- 
- 	if (ctx->reg_en)
- 		regulator_disable(ctx->reg_en);
- 
- 	return 0;
- }
- 
  #ifdef CONFIG_PM_SLEEP
  static int pwm_fan_suspend(struct device *dev)
  {

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

             reply	other threads:[~2019-05-15  0:05 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-15  0:05 Stephen Rothwell [this message]
  -- strict thread matches above, loose matches on Subject: below --
2019-05-13  0:49 linux-next: manual merge of the thermal-soc tree with Linus' tree Stephen Rothwell
2019-05-14  3:44 ` Eduardo Valentin
2019-05-14  4:40   ` Stephen Rothwell
2019-05-14 14:15     ` Eduardo Valentin
2019-05-15  0:44       ` Stephen Rothwell
2017-10-30 16:42 Mark 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=20190515100512.24b80412@canb.auug.org.au \
    --to=sfr@canb$(echo .)auug.org.au \
    --cc=edubezval@gmail$(echo .)com \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linux-next@vger$(echo .)kernel.org \
    --cc=linux@roeck-us$(echo .)net \
    --cc=robin.murphy@arm$(echo .)com \
    --cc=stefan.wahren@i2se$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox