watchdog: mpcore_wdt: Rename dev to pdev for pointing to struct platform_device

Pointer to struct platform_device is named as dev, which makes it confusing when
we write statements like dev->dev to access struct device within it.

This patch renames such names to pdev.

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
watchdog: mpcore_wdt: Use devm routines

mpcore_wdt driver currently uses normal kzalloc, request_irq, ioremap, etc
routines. This patch replaces these routines with devm_kzalloc and
devm_request_mem_region etc, so that we don't need to handle freeing of
resources for error cases and module removal routine.

Also, request_irq is moved before registering misc device, so that we are ready
for irq as soon as device is registered.

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
watchdog: mpcore_wdt: Allow platform_get_irq() to fail

irq is not necessary for mpcore wdt. Don't return error if it is not passed. But
if it is passed, then request_irq must pass.

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
watchdog: sp805: Fix documentation style comment

@ was missing before variables names, in their description. Also adev is
mentioned as dev in comment. Fix both these issues.

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
watchdog: sp805: replace readl/writel with lighter _relaxed variants

readl/writel versions for ARM contain memory barrier instruction for
synchronizing DMA buffers.  These are not required at least on this
module.  So use lighter _relaxed variants.

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
watchdog: sp805: Use devm routines

sp805 driver currently uses normal kzalloc, ioremap, etc routines. This patch
replaces these routines with devm_kzalloc and devm_request_mem_region etc, so
that we don't need to handle freeing of resources for error cases and module
removal routine.

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
watchdog: Convert ep93xx driver to watchdog core

Convert the ep93xx_wdt driver to the watchdog framework API.

Also, use the dev_<fmt> functions instead of pr_<fmt> for logging.

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Cc: Ryan Mallon <rmallon@gmail.com>
Cc: Mika Westerberg <mika.westerberg@iki.fi>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
watchdog: ep93xx_wdt: Fix timeout after conversion to watchdog core

After the conversion of this driver to the watchdog core, I noticed that we
miss setting the initial timeout of the wdt device.
This results in a failure of the WDIOC_GETTIMEOUT ioctl call.

Reviewed-by: Mika Westerberg <mika.westerberg@iki.fi>
Tested-by: Mika Westerberg <mika.westerberg@iki.fi>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
watchdog: ep93xx_wdt: timeout is an unsigned int value.

the timeout is a positive thus unsigned int value.
Also re-add the comment about the actual heartbeat.

Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
watchdog: Add support for WDIOC_GETTIMELEFT IOCTL in watchdog core

This patch adds support for WDIOC_GETTIMELEFT IOCTL in watchdog core. So, there
is another function pointer added to struct watchdog_ops, which can be passed by
drivers to support this IOCTL.

Related documentation is updated too.

Signed-off-by: Viresh Kumar <viresh.kumar@st.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
watchdog: coh901327: convert to use watchdog core

This converts the COH901327 watchdog to use the watchdog core.
I followed Wolframs document, looked at some other drivers and
tested it on the U300.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Cc: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
watchdog: coh901327_wdt.c: fix timeout

Set the timeout value properly so that we don't get faulty values
for the WDIOC_GETTIMEOUT iotcl. 'margin' should be an unsigned int.
Also add a check to see if margin is a valid parameter after it is
loaded as a module.

Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Wolfram Sang <w.sang@pengutronix.de>
watchdog: Convert txx9wdt driver to watchdog framework

This patch converts txx9wdt driver to watchdog framework.
Also use devm_* APIs to save a few error handling code.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
Acked-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
watchdog: txx9wdt: fix timeout

timeout should be an unsigned int.
Set the timeout value properly in the watchdog_device struct so that
we don't get an faulty values for the WDIOC_GETTIMEOUT ioctl call.
Add check to see that timeout is a valid parameter after it is loaded
as a module.

Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Acked-by: Wolfram Sang <w.sang@pengutronix.de>
Btrfs: introduce common define for max number of mirrors

Readahead already has a define for the max number of mirrors. Scrub
needs such a define now, the rest of the code will need something
like this soon. Therefore the define was added to ctree.h and removed
from the readahead code.

Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Btrfs: minor cleanup in scrub

Just a minor cleanup commit in preparation for the big block changes.

Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
Btrfs: change scrub to support big blocks

Scrub used to be coded for nodesize == leafsize == sectorsize == PAGE_SIZE.
This is now changed to support sizes for nodesize and leafsize which are
N * PAGE_SIZE.

Signed-off-by: Stefan Behrens <sbehrens@giantdisaster.de>
Signed-off-by: Chris Mason <chris.mason@oracle.com>
x86/olpc: Add debugfs interface for EC commands

Add a debugfs interface for sending commands to the OLPC
Embedded Controller (EC) and reading the responses.  The EC
provides functionality for machine identification, battery and
AC control, wakeup control, etc.

Having a debugfs interface available is useful for EC
development and debugging.

Based on code by Paul Fox (who also approves of the end result).

Signed-off-by: Daniel Drake <dsd@laptop.org>
Acked-by: Paul Fox <pgf@laptop.org>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Andres Salomon <dilinger@queued.net>
Link: http://lkml.kernel.org/r/20120327150740.667D09D401E@zog.reactivated.net
Signed-off-by: Ingo Molnar <mingo@kernel.org>
[CIFS] Update CIFS version number to 1.77

Signed-off-by: Steve French <sfrench@us.ibm.com>
SUNRPC: Use the already looked-up xprt in rpcb_getport_async()

rbcb_getport_async() was looking up the rpc_xprt (reference++) and then
later looking it up again (reference++) to pass through the
rpcbind_args.  The xprt would only be dereferenced once, when we were
done with the rpcbind_args (reference--).  This leaves an extra
reference to the transport that would never go away.

Signed-off-by: Bryan Schumaker <bjschuma@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>