Commit graph

79 commits

Author SHA1 Message Date
Eva Rachel Retuya
6504b9bdf6 staging: sm750fb: convert pr_err() to dev_err()
Replace pr_err() calls with respective dev_err() counterpart.
Change is safe since pdev is not NULL, this was identified by hand.
Semantic patch used to detect and apply the transformation:

@r exists@
identifier f,s,i;
position p;
@@

f(...,struct s *i,...) {
  <+...
  pr_err@p(...)
  ...+>
}

@s@
identifier r.s, dev;
@@

struct s {
	...
	struct device dev;
	...
};

@t@
identifier r.i, s.dev;
expression fmt;
position r.p;
@@

- pr_err@p(
+ dev_err(&i->dev,
			fmt, ...);

Signed-off-by: Eva Rachel Retuya <eraretuya@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Amitoj Kaur Chawla
13b79a0d88 staging: sm750fb: Use pcim_enable_device()
Devm_ functions allocate memory that is released when a driver
detaches.
Replace pci_enable_device with the managed pcim_enable_device
and remove corresponding pci_disable_device from probe and
suspend functions of a pci_dev.

Also, an unnecessary label has been removed by replacing it
with a direct return statement.

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Amitoj Kaur Chawla
677c507211 staging: sm750fb: Replace kzalloc with devm_kzalloc
Devm_ functions allocate memory that is released when a driver
detaches.
Replace kzalloc with devm_kzalloc and remove corresponding
kfrees from probe and remove functions of a pci_dev.

Also, an unnecessary label has been removed by replacing it
with a direct return statement.

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Amitoj Kaur Chawla
fad2564eaa staging: sm750fb: Remove unnecessary pci_set_drvdata()
Unnecessary pci_set_drvdata() has been removed since the driver
core clears the driver data to NULL after device release or on
probe failure. There is no need to manually clear the device
driver data to NULL.

The Coccinelle semantic patch used to make this change is as follows:
//<smpl>
@@
struct pci_dev *pci;
@@
- pci_set_drvdata(pci, NULL);
//</smpl>

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11 22:09:09 -08:00
Amitoj Kaur Chawla
16fdf7d5bd staging: sm750fb: Remove header files
Remove duplicate include files. Found using includecheck.

Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-22 12:03:22 -08:00
Matej Vasek
fbb8c96357 staging: sm750fb, fix typos
The code contained typos like "structur", "fointers", etc. Fix that.

No code change, only comments.

Signed-off-by: Matej Vasek <xvasek1@fi.muni.cz>
Cc: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Cc: Teddy Wang <teddy.wang@siliconmotion.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: <linux-fbdev@vger.kernel.org>
Cc: <devel@driverdev.osuosl.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 18:53:35 -08:00
Mike Rapoport
61da1a12d8 staging: sm750fb: lynxfb_pci_probe: remove some pr_info
Several pr_info statements in lynxfb_pci_probe seem like debug leftovers
and may be removed.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 18:50:53 -08:00
Mike Rapoport
a50bc32d32 staging: sm750fb: introduce sm750fb_frambuffer_alloc
Split framebuffer allocation and registration into a dedicated function
to simplify lynxfb_pci_probe

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 18:50:53 -08:00
Mike Rapoport
9324f9193b staging: sm750fb: introduce sm750fb_frambuffer_release
Use a function to unregister framebuffer info and release its resources.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 18:50:53 -08:00
Mike Rapoport
a3f92cc94c staging: sm750fb: replace dual member of sm750_dev with fb_count
Will be used in futher refactoring of driver _probe and _remove methods.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 18:50:53 -08:00
Mike Rapoport
473baa2df6 staging: sm750fb: lynxfb_pci_remove: remove unused variable
The par variable in lynxfb_pci_remove is only assigned a value and never
used afterwards. Remove it.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 18:50:53 -08:00
Mike Rapoport
baf24530a4 staging: sm750fb: lynxfb_pci_probe: return actual errors
The lynxfb_pci_probe always returned -ENODEV in case of error. Modify it
so that actual error code will be propogated to the caller.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 18:50:53 -08:00
Mike Rapoport
0fbc7c5056 staging: sm750fb: disable PCI device if lynxfb_pci_probe fails
In case of error during lynxfb_pci_probe, the function returned without
calling pci_disable_device. Fix it by adding pci_disable_device on the
error cleanup path.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07 18:50:53 -08:00
Shraddha Barke
cdfeaae5b3 Staging: sm750fb: Remove unused modedb.h file
The header file modedb.h is only included in sm750.c but the things
defined by modedb.h are not used anywhere in sm750.c. Thus, drop
the include in sm750.c and modedb.h can be dropped completely.

Signed-off-by: Shraddha Barke <shraddha.6596@gmail.com>
Acked-by: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-11-15 20:02:47 -08:00
Mike Rapoport
823e034c0f staging: sm750fb: remove '#ifdef CAP_EXP*' conditionals
There are several occurencies of '#ifdef CAP_EXP<something>', spelled
differently each time. None of these is ever defined and therefore they
enclose dead code that can be removed.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-27 17:04:57 +09:00
Mike Rapoport
e359b6a863 staging: sm750fb: merge lynx_share into sm750_dev
Both struct lynx_share and struct sm750_dev reprsent some parts of the
SM750 graphics adapter. There is no point to keep these parts in
different structures.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-27 17:04:57 +09:00
Mike Rapoport
8ac97f19df staging: sm750fb: remove unused field in lynx_cursor
The lynx_share field in lynx_cursor structure is never used and can be
removed.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-27 17:04:57 +09:00
Mike Rapoport
52e933278a staging: sm750fb: fix wrong indentation
Fix wrong indentation of a line in lynxfb_set_fbinfo

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-27 17:04:57 +09:00
Mike Rapoport
083c2048f5 staging: sm750fb: use sm750_dev with pci_{get, set}_drvdata
Use sm750_dev as private driver data for the PCI device

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-27 17:04:57 +09:00
Mike Rapoport
4fd92f51da staging: sm750fb: use 'struct sm750_dev *' instead of 'void *'
Use proper 'struct sm750_dev *' type instead of 'void *'

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-27 17:04:57 +09:00
Mike Rapoport
700591a9ad staging: sm750fb: replace lynx_share with sm750_dev in function calls
Use sm750_dev rather than lynx_share as parameter for hw_sm750_map,
hw_sm750_inithw and hw_sm750_initAccel functions.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-27 17:04:57 +09:00
Mike Rapoport
f11fa2a972 staging: sm750fb: replace lynx_share with sm750_dev in lynxfb_par
Use sm750_dev instead of lynx_share in the private data of the
frambuffer device.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-27 17:04:57 +09:00
Mike Rapoport
c96341916d staging: sm750fb: remove unused PROC_SPEC_* typedefs
The PROC_SPEC* typedefs are not used and can be removed

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-27 17:04:57 +09:00
Mike Rapoport
1757d106a9 staging: sm750fb: merge struct sm750_state into struct sm750_dev
The struct sm750_state is never used on its own. Merge it into the
struct sm750_dev.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-27 17:04:57 +09:00
Mike Rapoport
5ef2f68857 staging: sm750fb: rename 'struct sm750_dev' variables to sm750_dev
Use consistent naming for 'struct sm750_dev' variables

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-27 17:04:57 +09:00
Mike Rapoport
bc3d48f33e staging: sm750fb: rename struct sm750_share to sm750_dev
The struct sm750_share represents the device state and name sm750_dev
seems more appropriate.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-27 17:04:57 +09:00
Mike Rapoport
05407e153f staging: sm750fb: merge sm750_hw.h into sm750.h
There is no actual need to split type definitions and global function
declarations between lots of small headers.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-27 17:04:57 +09:00
Mike Rapoport
492bcecfd8 staging: sm750fb: remove unused smi_indent variable
The smi_indent variable is only declared, but never used. Remove it.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-27 17:04:57 +09:00
Mike Rapoport
e3a3f9f512 staging: sm750fb: replace PADDING macro with ALIGN
The custom macro PADDING differs from standard kernel ALIGN only in
parameters order. Replace PADDING with ALIGN and remove it's definition.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-27 17:04:57 +09:00
Mike Rapoport
fb7f40559e staging: sm750fb: replace lynx_cursor methods with function calls
The methods in lynx_cursor always use the same implementation and there is
no point to use redirection rather than direct function call.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-27 17:04:57 +09:00
Mike Rapoport
9821ed0479 staging: sm750fb: use direct call to hw_sm750_output_setMode
The proc_setMode method in lynx_output always uses the same
implementation and there is no point to use redirection rather than
direct function call.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24 19:04:13 -07:00
Mike Rapoport
c202beee7f staging: sm750fb: replace lynx_crtc methods with function calls
The methods in lynx_crtc always use the same implementation and there is
no point to use redirection rather than direct function call.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24 19:04:13 -07:00
Mike Rapoport
9b2941e27e staging: sm750fb: remove unused methods from lynx_share
The suspend and resume methods in lynx_share are not implemented and
never set. Remove them.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-24 19:04:13 -07:00
Shivani Bhardwaj
f955a398f2 Staging: sm750fb: sm750: Remove irrelevant code
The variable ret is only declared and initialized to 0, but never
referenced, so remove it.

Signed-off-by: Shivani Bhardwaj <shivanib134@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-16 22:05:40 -07:00
Binbin Zhou
31557ea033 staging: sm750fb: Fix the power state error in resume
The PM_EVENT_RESUME state is needed when SM750 resume, otherwise it
will be failed in the second time of continuous suspend/resume.

Cc: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Signed-off-by: Binbin Zhou <zhoubb@lemote.com>
Reviewed-by: Huacai Chen <chenhc@lemote.com>
Reviewed-by: Teddy Wang <teddy.wang@siliconmotion.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-12 20:33:51 -07:00
Mike Rapoport
4dc4d22555 staging: sm750fb: remove clear method from lynxfb_{crtc,output}
The clear methods of lynxfb_crtc and lynxfb_output are empty and
therefore they can be removed.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-02 11:50:52 +02:00
Mike Rapoport
efca4885b2 staging: sm750fb: remove proc_checkMode method from lynxfb_output
The proc_checkMode of lynxfb_output is set to function that always
returns 0. Calling that function and checking for its return value is
meaningless.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-02 11:50:52 +02:00
Mike Rapoport
104f456ce1 staging: sm750fb: remove unneeded switch statement
The lynxfb_ops_check_var function has two switch statements, the first
one checks for validity of var->bits_per_pixel and it is is immediatly
followed by another one that sets parameters according to
var->bits_per_pixel value. These switch statements can be merged into
one.

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-02 11:50:52 +02:00
Mike Rapoport
67088d49a1 staging: sm750fb: tidy up #include directives
Add space between '#include' keyword and the header name

Signed-off-by: Mike Rapoport <mike.rapoport@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-29 04:16:30 +02:00
Sudip Mukherjee
4063ea9af6 staging: sm750fb: simplify return
Lets return the return value directly instead of using a variable to
store the result.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-07 15:12:54 -07:00
Sudip Mukherjee
f8fbc838f4 staging: sm750fb: rearrange code
Rearrange the code to remove one exit label which also makes the code
less indented and more readable.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-07 15:12:54 -07:00
Sudip Mukherjee
d11ac7cbcc staging: sm750fb: fix multiline comment
Multiline comments are edited to be in the kernel coding style.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-07 15:12:54 -07:00
Sudip Mukherjee
13ef345822 staging: sm750fb: space around operator
Kernel coding style says to have a space around the operators.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-07 15:12:54 -07:00
Sudip Mukherjee
5fd93ddf32 staging: sm750fb: remove multiple blank line
Multiple blank lines are not kernel coding style and so checkpatch
complains. Remove them.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-08-07 15:12:54 -07:00
Juston Li
a1fe154f0f staging: sm750fb: remove unnecessary whitespace
Fixes checkpatch.pl warning:
WARNING: unnecessary whitespace before a quoted newline

Signed-off-by: Juston Li <juston.h.li@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-14 22:52:52 -07:00
Vinay Simha BN
df52568686 staging: sm750fb: coding style global ERROR fixes
kernel coding style fixes for below messages from
scripts/checkpatch.pl

ERROR: do not initialise globals to 0 or NULL

Signed-off-by: Vinay Simha BN <simhavcs@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-07-14 18:31:12 -07:00
Greg Donald
eb0f4271ca drivers: staging: sm750fb: Fix "'foo * bar' should be 'foo *bar'" errors
Fix checkpatch.pl "'foo * bar' should be 'foo *bar'" errors

Signed-off-by: Greg Donald <gdonald@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-18 21:07:07 -07:00
Hari Prasath Gujulan Elango
78cb7a38c6 staging: sm750fb: convert pr_err to pr_info
This patch modifies few debug prints from pr_err() to pr_info() as they
fall under that category.

Signed-off-by: Hari Prasath Gujulan Elango <hgujulan@visteon.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-06-18 21:07:07 -07:00
Masanari Iida
008272072d staging: sm750fb: Fix typo in sm750.c
This patch fix a spelling typo in printk within sm750.c

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-31 12:04:35 +09:00
Michel von Czettritz
c4eacdad9d staging: sm750fb: remove duplicate from fb_videomode
As suggested by Sudip this patch removes the redundant 1360x768@60
option from the fb_videomode struct array.
The removed option and the option one it differ in a typo and a flag.

Signed-off-by: Michel von Czettritz <michel.von.czettritz@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-05-31 12:04:35 +09:00