mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Krzysztof Kozlowski <k.kozlowski@samsung.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Mark Brown <broonie@kernel.org>,
	linux-kernel@vger.kernel.org, linux-input@vger.kernel.org,
	Jaewon Kim <jaewon02.kim@samsung.com>,
	Krzysztof Kozlowski <k.kozlowski@samsung.com>
Subject: [PATCH 1/4] Input: max77693: Remove a read-only pwm_divisor field
Date: Wed, 29 Jul 2015 15:31:27 +0900	[thread overview]
Message-ID: <1438151490-13751-2-git-send-email-k.kozlowski@samsung.com> (raw)
In-Reply-To: <1438151490-13751-1-git-send-email-k.kozlowski@samsung.com>

Storing a predefined PWM divisor in state container structure is
meaningless. The field, after initialization, is only read so this only
obfuscates the code. Remove the field and use directly enum value.

Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
---
 drivers/input/misc/max77693-haptic.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/input/misc/max77693-haptic.c b/drivers/input/misc/max77693-haptic.c
index 4524499ea72f..8dc43c1ebf0e 100644
--- a/drivers/input/misc/max77693-haptic.c
+++ b/drivers/input/misc/max77693-haptic.c
@@ -60,7 +60,6 @@ struct max77693_haptic {
 	unsigned int pwm_duty;
 	enum max77693_haptic_motor_type type;
 	enum max77693_haptic_pulse_mode mode;
-	enum max77693_haptic_pwm_divisor pwm_divisor;
 
 	struct work_struct work;
 };
@@ -88,7 +87,7 @@ static int max77693_haptic_configure(struct max77693_haptic *haptic,
 	value = ((haptic->type << MAX77693_CONFIG2_MODE) |
 		(enable << MAX77693_CONFIG2_MEN) |
 		(haptic->mode << MAX77693_CONFIG2_HTYP) |
-		(haptic->pwm_divisor));
+		MAX77693_HAPTIC_PWM_DIVISOR_128);
 
 	error = regmap_write(haptic->regmap_haptic,
 			     MAX77693_HAPTIC_REG_CONFIG2, value);
@@ -259,7 +258,6 @@ static int max77693_haptic_probe(struct platform_device *pdev)
 	haptic->dev = &pdev->dev;
 	haptic->type = MAX77693_HAPTIC_LRA;
 	haptic->mode = MAX77693_HAPTIC_EXTERNAL_MODE;
-	haptic->pwm_divisor = MAX77693_HAPTIC_PWM_DIVISOR_128;
 	haptic->suspend_state = false;
 
 	INIT_WORK(&haptic->work, max77693_haptic_play_work);
-- 
1.9.1


  reply	other threads:[~2015-07-29  6:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-29  6:31 [PATCH 0/4] Input: Merge max77843 haptic driver into max77693 Krzysztof Kozlowski
2015-07-29  6:31 ` Krzysztof Kozlowski [this message]
2015-07-29  6:31 ` [PATCH 2/4] Input: max77693: Prepare for adding support for Maxim 77843 Krzysztof Kozlowski
2015-07-29  6:31 ` [PATCH 3/4] Input: max77693: Add " Krzysztof Kozlowski
2015-07-29  6:31 ` [PATCH 4/4] Input: Remove the max77843 haptic driver Krzysztof Kozlowski
2015-07-29  6:55   ` Krzysztof Kozlowski
2015-07-29 17:08 ` [PATCH 0/4] Input: Merge max77843 haptic driver into max77693 Dmitry Torokhov
2015-07-29 23:43   ` Krzysztof Kozlowski

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=1438151490-13751-2-git-send-email-k.kozlowski@samsung.com \
    --to=k.kozlowski@samsung.com \
    --cc=broonie@kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=jaewon02.kim@samsung.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®