staging: panel: remove duplicate code
PATCH 1/1 staging: panel: remove duplicate code
both the misc_deregister(), parport_release() and parport_unregister_device() is there in the module_exit function also. detach is called from parport_unregister_driver() and by the time detach executes misc_deregister(), parport_release() and parport_unregister_device() has already executed marking keypad_initialized and lcd.initialized as false. so this part of the code will never execute.
--- drivers/staging/panel/panel.c | 14 -------------- 1 file changed, 14 deletions(-)
drivers/staging/panel/panel.c +0 -14
@@ -2252,20 +2252,6 @@ static void panel_detach(struct parport *port) }unregister_reboot_notifier (&panel_notifier); - -if (keypad.enabled && keypad_initialized) { -misc_deregister (&keypad_dev); - keypad_initialized =0 ; - } - -if (lcd.enabled && lcd.initialized) { -misc_deregister (&lcd_dev); - lcd.initialized = false; - } - -parport_release (pprt); -parport_unregister_device (pprt); - pprt =NULL ; }static struct parport_driver panel_driver = {
Signature · 1 line
1.8.1.2
Quoted 9 lines · Sudip Mukherjee
both the
misc_deregister(),parport_release()andparport_unregister_device()is there in themodule_exitfunction also. detach is called fromparport_unregister_driver()and by the time detach executesmisc_deregister(),parport_release()andparport_unregister_device()has already executed markingkeypad_initializedand lcd.initialized as false. so this part of the code will never execute.Signed-off-by Sudip Mukherjee <[email protected]>
A better subject might have been "remove dead code" but that was explained pretty well in the patch desription.
I hadn't looked at this driver much before. It sucks that parport_driver ->attach() functions can't fail... I think we don't need the "keypad_initialized" and "lcd.initialized" variables because "if (pprt)" is enough to tell us whether or not the attach function succeeded.
TODO: Staging: panel: remove some redundent variables.
regards,
dan carpenter
Quoted 4 lines · Dan Carpenter
On Tue, Apr 07, 2015 at 01:55:01PM +0530, Sudip Mukherjee wrote:
I hadn't looked at this driver much before. It sucks that
parport_driver->attach() functions can't fail...
then maybe, we can change the code of parport. currently attach and parport_register_driver never fails. we can modify it so that if attach fails then parport_register_driver will also fail. will not be that much difficult as it has been used only in 13 places.
your views ?
and since we are discussing parallel ports, few days back i saw one post in ubuntuforums that his scanner is not working because of lack of ppscsi.I mailed Tim Waugh, but he is not interested to work with ppscsi anymore. parallel port scanners are almost a thing of the past now. do you think it is worth that i pick up the code and modify it for our latest kernel and submit to Greg ?
regards
sudip
Quoted 3 lines
regards,
dan carpenter
Greg Kroah-Hartman
maintainerQuoted 12 lines · Sudip Mukherjee
Quoted 4 lines · Dan Carpenter
On Tue, Apr 07, 2015 at 01:55:01PM +0530, Sudip Mukherjee wrote:
I hadn't looked at this driver much before. It sucks that
parport_driver->attach() functions can't fail...then maybe, we can change the code of parport. currently attach and
parport_register_drivernever fails. we can modify it so that if attach fails thenparport_register_driverwill also fail. will not be that much difficult as it has been used only in 13 places.
your views ?
Quoted 6 lines
and since we are discussing parallel ports, few days back i saw one post in ubuntuforums that his scanner is not working because of lack of ppscsi.I mailed Tim Waugh, but he is not interested to work with ppscsi anymore. parallel port scanners are almost a thing of the past now. do you think it is worth that i pick up the code and modify it for our latest kernel and submit to Greg ?
If you have some parport hardware, and want to take it on, that would be great. The code needs a maintainer, and the apis are _really_ old and messy, as you have found out.
I'll be glad to shephard parport patches to Linus, as I've been doing that semi-regularly for a few years now, through my char-misc git tree.
thanks,
greg k-h
Quoted 20 lines · Greg Kroah-Hartman
Quoted 12 lines · Sudip Mukherjee
Quoted 4 lines · Dan Carpenter
On Tue, Apr 07, 2015 at 01:55:01PM +0530, Sudip Mukherjee wrote:
I hadn't looked at this driver much before. It sucks that
parport_driver->attach() functions can't fail...then maybe, we can change the code of parport. currently attach and
parport_register_drivernever fails. we can modify it so that if attach fails thenparport_register_driverwill also fail. will not be that much difficult as it has been used only in 13 places.
your views ?Quoted 6 lines
and since we are discussing parallel ports, few days back i saw one post in ubuntuforums that his scanner is not working because of lack of ppscsi.I mailed Tim Waugh, but he is not interested to work with ppscsi anymore. parallel port scanners are almost a thing of the past now. do you think it is worth that i pick up the code and modify it for our latest kernel and submit to Greg ?
Quoted 3 lines
If you have some parport hardware, and want to take it on, that would be great. The code needs a maintainer, and the apis are _really_ old and messy, as you have found out.
what kind of parport hardware will you suggest?
regards
sudip
Quoted 7 lines
I'll be glad to shephard parport patches to Linus, as I've been doing that semi-regularly for a few years now, through my char-misc git tree.
thanks,
greg k-h
Greg Kroah-Hartman
maintainerQuoted 21 lines · Sudip Mukherjee
Quoted 20 lines · Greg Kroah-Hartman
Quoted 18 lines · Sudip Mukherjee
Quoted 4 lines · Dan Carpenter
On Tue, Apr 07, 2015 at 01:55:01PM +0530, Sudip Mukherjee wrote:
I hadn't looked at this driver much before. It sucks that
parport_driver->attach() functions can't fail...then maybe, we can change the code of parport. currently attach and
parport_register_drivernever fails. we can modify it so that if attach fails thenparport_register_driverwill also fail. will not be that much difficult as it has been used only in 13 places.
your views ?and since we are discussing parallel ports, few days back i saw one post in ubuntuforums that his scanner is not working because of lack of ppscsi.I mailed Tim Waugh, but he is not interested to work with ppscsi anymore. parallel port scanners are almost a thing of the past now. do you think it is worth that i pick up the code and modify it for our latest kernel and submit to Greg ?
Quoted 4 lines
Quoted 3 lines
If you have some parport hardware, and want to take it on, that would be great. The code needs a maintainer, and the apis are _really_ old and messy, as you have found out.
what kind of parport hardware will you suggest?
No idea, go look at the drivers and code to figure that out.
Quoted 22 lines · Greg Kroah-Hartman
Quoted 21 lines · Sudip Mukherjee
Quoted 20 lines · Greg Kroah-Hartman
Quoted 18 lines · Sudip Mukherjee
Quoted 4 lines · Dan Carpenter
On Tue, Apr 07, 2015 at 01:55:01PM +0530, Sudip Mukherjee wrote:
I hadn't looked at this driver much before. It sucks that
parport_driver->attach() functions can't fail...then maybe, we can change the code of parport. currently attach and
parport_register_drivernever fails. we can modify it so that if attach fails thenparport_register_driverwill also fail. will not be that much difficult as it has been used only in 13 places.
your views ?and since we are discussing parallel ports, few days back i saw one post in ubuntuforums that his scanner is not working because of lack of ppscsi.I mailed Tim Waugh, but he is not interested to work with ppscsi anymore. parallel port scanners are almost a thing of the past now. do you think it is worth that i pick up the code and modify it for our latest kernel and submit to Greg ?
Quoted 6 lines
Quoted 4 lines
Quoted 3 lines
If you have some parport hardware, and want to take it on, that would be great. The code needs a maintainer, and the apis are _really_ old and messy, as you have found out.
what kind of parport hardware will you suggest?
No idea, go look at the drivers and code to figure that out.
Not-so-old laptops used to have parport connectors for a while, and can be found at a very cheap price or even for free by now with dead batteries. I've been using mine as a JTAG connector exclusively until I replaced this laptop.
A number of old mini-itx boards used to have a parallell port and were easy to hack on (eg: those with a jack power connector, onboard video and a PXE capable NIC to boot the freshly built kernel over the network). They're less easy to find though.
If you want to run on your PC, you'll have to order a PCIe parallel port NIC I guess.
Cheers,
Willy
Quoted 6 lines · Willy Tarreau
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 2 lines
now. do you think it is worth that i pick up the code and modify it for our latest kernel and submit to Greg ?
If you have some parport hardware, and want to take it on, that would be great. The code needs a maintainer, and the apis are _really_ old and messy, as you have found out.
Quoted 6 lines
Quoted 3 lines
Quoted 1 line
what kind of parport hardware will you suggest?
No idea, go look at the drivers and code to figure that out.
Not-so-old laptops used to have parport connectors for a while, and can be found at a very cheap price or even for free by now with dead batteries.
free laptop sounds good.. :)
where can i get some?
Quoted 8 lines
A number of old mini-itx boards used to have a parallell port and were easy to hack on (eg: those with a jack power connector, onboard video and a PXE capable NIC to boot the freshly built kernel over the network). They're less easy to find though.
If you want to run on your PC, you'll have to order a PCIe parallel port NIC I guess.
i already have pc with parallel port, and on that i check your panel codes before sending. but here we were discussing about the required hardware to test ppscsi module.
regards
sudip
Quoted 4 lines
Cheers,
Willy
Quoted 5 lines · Sudip Mukherjee
Quoted 2 lines · Willy Tarreau
Not-so-old laptops used to have parport connectors for a while, and can be found at a very cheap price or even for free by now with dead batteries.
free laptop sounds good.. :)
where can i get some?
Friends replacing theirs in general, or your employer's dead stock :-)
Quoted 1 line
Quoted 1 line
If you want to run on your PC, you'll have to order a PCIe parallel port NIC
s/NIC/card above
Quoted 4 lines
Quoted 1 line
I guess.
i already have pc with parallel port, and on that i check your panel codes before sending. but here we were discussing about the required hardware to test ppscsi module.
Ah sorry for being out of topic then, I missed this point, I thought it was for PP in general.
Regards,
Willy
Quoted 22 lines · Greg Kroah-Hartman
Quoted 21 lines · Sudip Mukherjee
Quoted 20 lines · Greg Kroah-Hartman
Quoted 18 lines · Sudip Mukherjee
Quoted 4 lines · Dan Carpenter
On Tue, Apr 07, 2015 at 01:55:01PM +0530, Sudip Mukherjee wrote:
I hadn't looked at this driver much before. It sucks that
parport_driver->attach() functions can't fail...then maybe, we can change the code of parport. currently attach and
parport_register_drivernever fails. we can modify it so that if attach fails thenparport_register_driverwill also fail. will not be that much difficult as it has been used only in 13 places.
your views ?and since we are discussing parallel ports, few days back i saw one post in ubuntuforums that his scanner is not working because of lack of ppscsi.I mailed Tim Waugh, but he is not interested to work with ppscsi anymore. parallel port scanners are almost a thing of the past now. do you think it is worth that i pick up the code and modify it for our latest kernel and submit to Greg ?
Quoted 6 lines
Quoted 4 lines
Quoted 3 lines
If you have some parport hardware, and want to take it on, that would be great. The code needs a maintainer, and the apis are _really_ old and messy, as you have found out.
what kind of parport hardware will you suggest?
No idea, go look at the drivers and code to figure that out.
i guess i asked the question in a wrong way.
i already have pc with parport. what i wanted to ask was do i need any other hardware (like parallel port scanner) to start with ppscsi?
regards
sudip
Quoted 11 lines · Sudip Mukherjee
Quoted 4 lines · Dan Carpenter
On Tue, Apr 07, 2015 at 01:55:01PM +0530, Sudip Mukherjee wrote:
I hadn't looked at this driver much before. It sucks that
parport_driver->attach() functions can't fail...then maybe, we can change the code of parport. currently attach and
parport_register_drivernever fails. we can modify it so that if attach fails thenparport_register_driverwill also fail. will not be that much difficult as it has been used only in 13 places.
your views ?
If you write the patch then I will review it. :)
Quoted 7 lines
and since we are discussing parallel ports, few days back i saw one post in ubuntuforums that his scanner is not working because of lack of ppscsi.I mailed Tim Waugh, but he is not interested to work with ppscsi anymore. parallel port scanners are almost a thing of the past now. do you think it is worth that i pick up the code and modify it for our latest kernel and submit to Greg ?
If you want to do the work, I won't say no! :P
regards,
dan carpenter
Quoted 3 lines · Dan Carpenter
On Tue, Apr 07, 2015 at 02:55:02PM +0530, Sudip Mukherjee wrote:
If you write the patch then I will review it. :)
sure, I am on it.
Quoted 7 lines
Quoted 5 lines
lack of ppscsi.I mailed Tim Waugh, but he is not interested to work with ppscsi anymore. parallel port scanners are almost a thing of the past now. do you think it is worth that i pick up the code and modify it for our latest kernel and submit to Greg ?
If you want to do the work, I won't say no! :P
and, can you please suggest what kind of hardware should i try to find to work with ppscsi. i saw parallel port scanners or zip drives will be using that module. any other hardware apart from these?
regards
sudip
Quoted 4 lines
regards,
dan carpenter