From: Guenter Roeck <guenter.roeck@ericsson.com>
To: lm-sensors@vger.kernel.org
Subject: Re: [lm-sensors] [PATCH v5] hwmon: Add driver for EXYNOS4 TMU
Date: Fri, 02 Sep 2011 13:54:40 +0000 [thread overview]
Message-ID: <20110902135440.GA30543@ericsson.com> (raw)
In-Reply-To: <1314955144-18168-1-git-send-email-dg77.kim@samsung.com>
On Fri, Sep 02, 2011 at 05:19:04AM -0400, Donggeun Kim wrote:
> This patch allows to read temperature
> from TMU(Thermal Management Unit) of SAMSUNG EXYNOS4 series of SoC.
>
> Signed-off-by: Donggeun Kim <dg77.kim@samsung.com>
> Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
> Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
[ ... ]
> +
> +struct exynos4_tmu_data {
> + struct exynos4_tmu_platform_data *pdata;
> + struct device *hwmon_dev;
> + struct resource *mem;
> + void __iomem *base;
> + int irq;
> + struct work_struct irq_work;
> + struct mutex lock;
> + struct clk *clk;
> + unsigned int interrupt_stat;
I just noticed that this variable is only set and used in one function,
so you can keep it as local variable there.
> + u8 temp_error1, temp_error2;
> +};
[ ... ]
> +
> +static int exynos4_tmu_read(struct exynos4_tmu_data *data)
> +{
> + u8 temp_code, temp;
> +
> + mutex_lock(&data->lock);
> + clk_enable(data->clk);
> +
> + temp_code = readb(data->base + EXYNOS4_TMU_REG_CURRENT_TEMP);
> + temp = code_to_temp(data, temp_code);
temp is now an u8, so assigning a negative error to it won't do much good.
> +
> + clk_disable(data->clk);
> + mutex_unlock(&data->lock);
> +
> + return temp;
> +}
> +
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
prev parent reply other threads:[~2011-09-02 13:54 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-09-02 9:19 [lm-sensors] [PATCH v5] hwmon: Add driver for EXYNOS4 TMU Donggeun Kim
2011-09-02 13:54 ` Guenter Roeck [this message]
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=20110902135440.GA30543@ericsson.com \
--to=guenter.roeck@ericsson.com \
--cc=lm-sensors@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 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.