Re: Input: add MAX7359 key switch controller driver



Hi Kim,


Could you please restrict the commit text line to 80/72 columns? It
will look good.

Is this restriction for commit text mandatory? It seems like I got an
email from Andrew Morton that my patch was wordwraped even commit
text.

This helps reader of the commit text to not give much stretch on his eyes :)


+
+static int __devinit max7359_probe(struct i2c_client *client,
+                                       const struct i2c_device_id *id)

You may want to remove __devinit as it is i2c client driver . I have
added linux-i2c for i2c specific review.

Actually I don't want to remove it :), Is there any reason why you think so?

Sorry I have mistaken it as __init. This is fine.


+static int max7359_suspend(struct i2c_client *client, pm_message_t mesg)
+{
+       /* If no keys are pressed, enter sleep mode for 8192 ms */
+       max7359_write_reg(client, MAX7359_REG_SLEEP, 0x01);
+
+       return 0;
+}
+
+static int max7359_resume(struct i2c_client *client)
+{
+       /* Restore the default setting (autosleep for 256 ms) */
+       max7359_write_reg(client, MAX7359_REG_SLEEP, 0x07);
+
+       return 0;
+}

Protect these two function with #ifdef CONFIG_PM please.

This is what I really wanted to ask. I'm trying not to use '#ifdef'.
By the way, why most of drivers use protect suspend/resume functions
with #ifdef? Just for saving code size?

suspend and resume is only important if the user of this driver has
CONFIG_PM enabled in it's
defconfig, right? So, if CONFIG_PM is not defined suspend/resume
should equal to NULL.



+};
+
+
+MODULE_AUTHOR("Kim Kyuwon <q1.kim@xxxxxxxxxxx>");
+MODULE_DESCRIPTION("MAX7359 Key Switch Controller Driver");
+MODULE_LICENSE("GPL v2");

MODULE_ALIAS ??

In 'include/linux/module.h'

 96 /* For userspace: you can also call me... */
 97 #define MODULE_ALIAS(_alias) MODULE_INFO(alias, _alias)

From comment above, I think MODULE_ALIAS is optional. Do you still
think MODULE_ALIAS needs?


Yes, it is not __must__.

--
---Trilok Soni
http://triloksoni.wordpress.com
http://www.linkedin.com/in/triloksoni
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



Relevant Pages

  • [git pull] drm fixes for 2.6.27-rc5
    ... 965/GM45 suspend/resume. ... some fixes for quite soon, and the AGP on PAE issue is still outstanding. ... commit 0baf823a10bd4131f70e9712d1f02de3c247f1df ... now so that each driver has its own pci id list header in its own directory. ...
    (Linux-Kernel)
  • [GIT PATCH] ACPI patches for 2.6.21 - part II (resend)
    ... Adds the sony-laptop driver, which controls brightness on akpm's vaio... ... Adds the ACPI support needed by the upcoming rtc driver ... ACPI: bay: fix wrong order of kzalloc arguments ... commit 255f0385c8e0d6b9005c0e09fffb5bd852f3b506 ...
    (Linux-Kernel)
  • Re: [RESEND x9+ patch 2.6.26-git 1/2] lm75: cleanup and reorg
    ... This patch have been in Mark's tree for a month or so. ... commit 530598a47e8562f680d155eb280dddd6af1b3d9e ... hwmon: ... Misc cleanups to the lm85 hardware monitoring driver: ...
    (Linux-Kernel)
  • cvs-src summary for 04/04/2004
    ... You can get old summaries, and an HTML version of this one, at ... Vinod Hashyap added a driver for `3ware's 9000 series`_ ... depending on which branch the commit is being made to. ... this same change means that USB keyboards will not be ...
    (freebsd-current)
  • [git pull request] ACPI patches for 2.6.32-rc1
    ... sony-laptop: Don't unregister the SPIC driver if it wasn't registered ... ACPI: EC: Restart command even if no interrupts from EC ... commit c7db7ba5fc84e76044f403efbbba3af5fb01d19b ...
    (Linux-Kernel)