Commit Graph

29 Commits

Author SHA1 Message Date
Hanjun Guo
11f9c3218b Staging / quickstart: remove reduplicate if(acpi_disabled) check
In acpi_bus_register_driver(), there is an if (acpi_disabled) check,
so the if(acpi_disabled) before it is reduplicate, remove it.

Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-09-25 16:48:45 -07:00
Greg Kroah-Hartman
3b7cf04f87 staging: quickstart: fix up sysfs file permissions
Use the default DEVICE_ATTR_RO/RW macros to specify the file permissions
better, and make them easier to audit.

And did we really want any user to be able to write to this file, I kind
of doubt it...

Cc: Jiang Liu <jiang.liu@huawei.com>
Cc: Toshi Kani <toshi.kani@hp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-08-24 10:34:53 -07:00
Rafael J. Wysocki
51fac8388a ACPI: Remove useless type argument of driver .remove() operation
The second argument of ACPI driver .remove() operation is only used
by the ACPI processor driver and the value passed to that driver
through it is always available from the given struct acpi_device
object's removal_type field.  For this reason, the second ACPI driver
.remove() argument is in fact useless, so drop it.

Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Reviewed-by: Jiang Liu <jiang.liu@huawei.com>
Acked-by: Toshi Kani <toshi.kani@hp.com>
Acked-by: Yinghai Lu <yinghai@kernel.org>
2013-01-26 00:37:24 +01:00
Szymon Janc
5f01f7f301 Staging: quickstart: Fix compilation warning on 64 bit arch
acpi_size is u32 or u64 depending on architecture. Cast it to
unsigned long and use %lu for printing.

This fix following build warning:
drivers/staging/quickstart/quickstart.c: In function ‘quickstart_acpi_ghid’:
drivers/staging/quickstart/quickstart.c:212:5: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 3 has type ‘acpi_size’ [-Wformat]

Signed-off-by: Szymon Janc <szymon@janc.net.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-13 20:08:56 -08:00
Szymon Janc
af5728e08a Staging: quickstart: Bump driver version to 1.04
Signed-off-by: Szymon Janc <szymon@janc.net.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-13 20:08:55 -08:00
Szymon Janc
e66912af2c Staging: quickstart: Use scnprintf in quickstart_pressed_button_show
Use scnprintf instead of snprintf in quickstart_pressed_button_show as
suggested in Documentation/filesystems/sysfs.txt.

Signed-off-by: Szymon Janc <szymon@janc.net.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-13 20:08:55 -08:00
Szymon Janc
74eabe4ca2 Staging: quickstart: Use pr_err and pr_info for logs
Signed-off-by: Szymon Janc <szymon@janc.net.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-09 09:41:33 -08:00
Szymon Janc
3c92e38dc4 Staging: quickstart: Rename quickstart_btn to quickstart_button
Signed-off-by: Szymon Janc <szymon@janc.net.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08 17:16:51 -08:00
Szymon Janc
21c1ddf314 Staging: quickstart: Use %u for printing button id
Button id is of unsigned int type.

Signed-off-by: Szymon Janc <szymon@janc.net.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08 17:16:50 -08:00
Szymon Janc
505d2ad227 Staging: quickstart: Use list.h API for buttons list
Signed-off-by: Szymon Janc <szymon@janc.net.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08 17:16:50 -08:00
Szymon Janc
3991eae943 Staging: quickstart: Get rid of quickstart_data struct
Signed-off-by: Szymon Janc <szymon@janc.net.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08 17:16:50 -08:00
Szymon Janc
4a0908322a Staging: quickstart: Remove unused defines
Signed-off-by: Szymon Janc <szymon@janc.net.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08 17:16:49 -08:00
Szymon Janc
55e4036986 Staging: quickstart: Use switch-case in quickstart_acpi_notify
Signed-off-by: Szymon Janc <szymon@janc.net.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08 17:16:49 -08:00
Szymon Janc
ffe1c0565c Staging: quickstart: Cleanup quickstart_acpi_config
Signed-off-by: Szymon Janc <szymon@janc.net.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08 17:16:49 -08:00
Szymon Janc
f27a551968 Staging: quickstart: Cleanup quickstart_acpi_add
Signed-off-by: Szymon Janc <szymon@janc.net.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08 17:16:49 -08:00
Szymon Janc
60955f15d9 Staging: quickstart: Cleanup quickstart_acpi_remove
Signed-off-by: Szymon Janc <szymon@janc.net.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08 17:16:48 -08:00
Szymon Janc
2ac16967b8 Staging: quickstart: Cleanup quickstart_acpi_ghid
Also fix memory leak (buffer.pointer) when returned buffer of length
less than 8.

Signed-off-by: Szymon Janc <szymon@janc.net.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08 17:16:48 -08:00
Szymon Janc
1692caa949 Staging: quickstart: Make quickstart_input static
Signed-off-by: Szymon Janc <szymon@janc.net.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08 17:16:48 -08:00
Szymon Janc
605926ef5a Staging: quickstart: Move some code to avoid forward declarations
Signed-off-by: Szymon Janc <szymon@janc.net.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08 17:16:47 -08:00
Szymon Janc
7267d2610a Staging: quickstart: Prefix remaining functions names with quickstart_
Signed-off-by: Szymon Janc <szymon@janc.net.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08 17:16:47 -08:00
Szymon Janc
5c9ed5bedf Staging: quickstart: Some style, whitespaces and typos fixes
Signed-off-by: Szymon Janc <szymon@janc.net.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08 17:16:47 -08:00
Timo von Holtz
f94fdeaa58 Staging: quickstart: fixed coding style issues
Fixed the Following coding Style Issues:
drivers/staging/quickstart/quickstart.c:8: ERROR: trailing whitespace
drivers/staging/quickstart/quickstart.c:144: ERROR: spaces required around that '?' (ctx:VxV)
drivers/staging/quickstart/quickstart.c:144: ERROR: spaces required around that ':' (ctx:VxV)

Signed-off-by: Timo von Holtz <tvh@informatik.uni-kiel.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-02-09 12:11:55 -08:00
Dan Carpenter
ebba26f4a8 Staging: quickstart: free after input_unregister_device()
input_unregister_device() releases "quickstart_input" so the
input_free_device() is a double free.  Also I noticed that there is a
memory leak if the call to input_register_device() fails.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-16 12:25:52 -08:00
Greg Kroah-Hartman
e4c5bf8e3d Merge 'staging-next' to Linus's tree
This merges the staging-next tree to Linus's tree and resolves
some conflicts that were present due to changes in other trees that were
affected by files here.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-10-28 09:44:56 -07:00
Justin P. Mattock
631dd1a885 Update broken web addresses in the kernel.
The patch below updates broken web addresses in the kernel

Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
Cc: Maciej W. Rozycki <macro@linux-mips.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Finn Thain <fthain@telegraphics.com.au>
Cc: Randy Dunlap <rdunlap@xenotime.net>
Cc: Matt Turner <mattst88@gmail.com>
Cc: Dimitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Mike Frysinger <vapier.adi@gmail.com>
Acked-by: Ben Pfaff <blp@cs.stanford.edu>
Acked-by: Hans J. Koch <hjk@linutronix.de>
Reviewed-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-10-18 11:03:14 +02:00
Dan Carpenter
f090386309 Staging: quickstart: acpi_status is unsigned
acpi_bus_register_driver() returns an int, not acpi_status.  It returns
zero on success and negative error codes on failure, but acpi_status is
unsigned.  We can just use "ret" here.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-31 14:48:09 -07:00
Randy Dunlap
57778ef92c Staging: quickstart: depends on INPUT
quickstart uses input_*() functions so it should depend on INPUT.

ERROR: "input_register_device" [drivers/staging/quickstart/quickstart.ko] undefined!
ERROR: "input_allocate_device" [drivers/staging/quickstart/quickstart.ko] undefined!
ERROR: "input_event" [drivers/staging/quickstart/quickstart.ko] undefined!
ERROR: "input_free_device" [drivers/staging/quickstart/quickstart.ko] undefined!
ERROR: "input_unregister_device" [drivers/staging/quickstart/quickstart.ko] undefined!

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Cc: Angelo Arrifano <miknix@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-08-02 18:12:46 -07:00
Greg Kroah-Hartman
8dd1260f93 Staging: quickstart: add the quickstart driver to the build
This adds the needed Kconfig and Makefile changes to add
the quickstart driver to the build.

Cc: Angelo Arrifano <miknix@gentoo.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-08 16:25:55 -07:00
Angelo Arrifano
6da4cd4690 Staging: add quickstart acpi key driver
This adds the quickstart acpi key driver to the staging tree

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-08 16:22:31 -07:00