From: Christopher Heiny <cheiny@synaptics.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Courtney Cavin <courtney.cavin@sonymobile.com>,
linux-input@vger.kernel.org
Subject: Re: [PATCH 01/15] Input: synaptics-rmi4 - fix checkpatch.pl, sparse and GCC warnings
Date: Thu, 13 Feb 2014 11:25:33 -0800 [thread overview]
Message-ID: <52FD1C2D.8050901@synaptics.com> (raw)
In-Reply-To: <20140213191216.GA3916@core.coreip.homeip.net>
On 02/13/2014 11:12 AM, Dmitry Torokhov wrote:
> On Thu, Feb 13, 2014 at 11:10:29AM -0800, Dmitry Torokhov wrote:
>> On Thursday, February 13, 2014 10:56:25 AM Christopher Heiny wrote:
>>> On 02/12/2014 10:36 PM, Dmitry Torokhov wrote:
>>>> On Wed, Feb 05, 2014 at 05:36:09PM -0800, Christopher Heiny wrote:
>>>>>> On 02/05/2014 05:09 PM, Dmitry Torokhov wrote:
>>>>>>>> On Tue, Feb 04, 2014 at 03:08:12PM -0800, Christopher Heiny wrote:
>>>>>>>>>>>> On 01/23/2014 04:00 PM, Courtney Cavin wrote:
>>>>>>>>>>>>>>>> Cc: Christopher Heiny<cheiny@synaptics.com>
>>>>>>>>>>>>>>>> Cc: Dmitry Torokhov<dmitry.torokhov@gmail.com>
>>>>>>>>>>>>>>>> Signed-off-by: Courtney Cavin<courtney.cavin@sonymobile.com>
>>>>>>>>>>>>>>>> ---
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> drivers/input/rmi4/rmi_bus.c | 4 ++--
>>>>>>>>>>>>>>>> drivers/input/rmi4/rmi_bus.h | 2 +-
>>>>>>>>>>>>>>>> drivers/input/rmi4/rmi_driver.c | 17 ++++++++++++-----
>>>>>>>>>>>>>>>> drivers/input/rmi4/rmi_f11.c | 4 +++-
>>>>>>>>>>>>>>>> 4 files changed, 18 insertions(+), 9 deletions(-)
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> diff --git a/drivers/input/rmi4/rmi_bus.c
>>>>>>>>>>>>>>>> b/drivers/input/rmi4/rmi_bus.c
>>>>>>>>>>>>>>>> index 96a76e7..8a939f3 100644
>>>>>>>>>>>>>>>> --- a/drivers/input/rmi4/rmi_bus.c
>>>>>>>>>>>>>>>> +++ b/drivers/input/rmi4/rmi_bus.c
>>>>>>>>>>>>>>>> @@ -37,7 +37,7 @@ static void rmi_release_device(struct
>>>>>>>>>>>>>>>> device *dev)
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> kfree(rmi_dev);
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> }
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> -struct device_type rmi_device_type = {
>>>>>>>>>>>>>>>> +static struct device_type rmi_device_type = {
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> .name = "rmi_sensor",
>>>>>>>>>>>>>>>> .release = rmi_release_device,
>>>>>>>>>>>>>>>>
>>>>>>>>>>>>>>>> };
>>>>>>>>>>>>
>>>>>>>>>>>> This struct is used by diagnostic modules to identify sensor
>>>>>>>>>>>> devices, so it cannot be static.
>>>>>>>>
>>>>>>>> Then we need to declare it somewhere or provide an accessor function.
>>>>>>
>>>>>> Currently it's in a header not included in the patches. We'll move
>>>>>> it to rmi_bus.h.
>>>>
>>>> Hmm, we do have rmi_is_physical_device() to identify whether it is a
>>>> sensor or a function, so I believe we should mark all structures static
>>>> to avoid anyone poking at them.
>>>
>>> I was poking around in the dependent code late last night and came to
>>> the same conclusion. I'll send a micropatch later today to get it out
>>> of the way.
>>
>> No need, I untangled relevant bits from the one Courtney sent.
Thanks!
>>
>> Thanks.
>
> Here it is by the way.
>
> Input: synaptics-rmi4 - make device types module-private
>
> From: Courtney Cavin <courtney.cavin@sonymobile.com>
>
> Nobody outside of RMI bus core should be accessing rmi_device_type,
> rmi_function_type or rmi_physical_driver structures so let's limit their
> scope.
>
> We provide rmi_is_physical_device() and rmi_is_function_device() to allow
> determining whether one is dealing with sensor or function device.
>
> Signed-off-by: Courtney Cavin <courtney.cavin@sonymobile.com>
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Christopher Heiny <cheiny@synaptics.com>
> ---
> drivers/input/rmi4/rmi_bus.c | 4 ++--
> drivers/input/rmi4/rmi_driver.c | 2 +-
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/input/rmi4/rmi_bus.c b/drivers/input/rmi4/rmi_bus.c
> index 7efe7ed..6e0454a 100644
> --- a/drivers/input/rmi4/rmi_bus.c
> +++ b/drivers/input/rmi4/rmi_bus.c
> @@ -38,7 +38,7 @@ static void rmi_release_device(struct device *dev)
> kfree(rmi_dev);
> }
>
> -struct device_type rmi_device_type = {
> +static struct device_type rmi_device_type = {
> .name = "rmi_sensor",
> .release = rmi_release_device,
> };
> @@ -154,7 +154,7 @@ static void rmi_release_function(struct device *dev)
> kfree(fn);
> }
>
> -struct device_type rmi_function_type = {
> +static struct device_type rmi_function_type = {
> .name = "rmi_function",
> .release = rmi_release_function,
> };
> diff --git a/drivers/input/rmi4/rmi_driver.c b/drivers/input/rmi4/rmi_driver.c
> index 788343a..4406a7f 100644
> --- a/drivers/input/rmi4/rmi_driver.c
> +++ b/drivers/input/rmi4/rmi_driver.c
> @@ -946,7 +946,7 @@ err_free_mem:
> return retval < 0 ? retval : 0;
> }
>
> -struct rmi_driver rmi_physical_driver = {
> +static struct rmi_driver rmi_physical_driver = {
> .driver = {
> .owner = THIS_MODULE,
> .name = "rmi_physical",
>
--
Christopher Heiny
Senior Staff Firmware Engineer
Synaptics Incorporated
next prev parent reply other threads:[~2014-02-13 19:25 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-24 0:00 [PATCH 00/15] Input: synaptics-rmi4 - cleanup and add DT support Courtney Cavin
2014-01-24 0:00 ` [PATCH 01/15] Input: synaptics-rmi4 - fix checkpatch.pl, sparse and GCC warnings Courtney Cavin
2014-01-24 0:00 ` [PATCH 02/15] Input: synaptics-rmi4 - don't kfree devm_ alloced memory Courtney Cavin
2014-01-24 0:00 ` [PATCH 03/15] Input: synaptics-rmi4 - don't free devices directly Courtney Cavin
2014-01-24 0:00 ` [PATCH 04/15] Input: synaptics-rmi4 - remove sensor name from platform data Courtney Cavin
2014-01-24 0:00 ` [PATCH 05/15] Input: synaptics-rmi4 - remove gpio handling and polling Courtney Cavin
2014-01-24 0:00 ` [PATCH 06/15] Input: synaptics-rmi4 - remove platform suspend callbacks Courtney Cavin
2014-01-24 0:00 ` [PATCH 07/15] Input: synaptics-rmi4 - remove remaining debugfs code Courtney Cavin
2014-01-24 0:00 ` [PATCH 08/15] Input: synaptics-rmi4 - cleanup platform data Courtney Cavin
2014-01-24 0:00 ` [PATCH 09/15] Input: synaptics-rmi4 - remove unused defines and variables Courtney Cavin
2014-01-24 0:00 ` [PATCH 10/15] Input: synaptics-rmi4 - add devicetree support Courtney Cavin
2014-01-24 0:00 ` [PATCH 11/15] Input: synaptics-rmi4 - add regulator support Courtney Cavin
2014-01-24 0:00 ` [PATCH 12/15] Input: synaptics-rmi4 - don't immediately set page on probe Courtney Cavin
2014-01-24 0:00 ` [PATCH 13/15] Input: synaptics-rmi4 - properly set F01 container on PDT scan Courtney Cavin
2014-01-24 0:00 ` [PATCH 14/15] Input: synaptics-rmi4 - ensure we have IRQs before reading status Courtney Cavin
2014-01-24 0:00 ` [PATCH 15/15] Input: synaptics-rmi4 - correct RMI4 spec url Courtney Cavin
2014-02-04 23:10 ` Christopher Heiny
2014-02-06 1:14 ` Dmitry Torokhov
2014-02-04 23:10 ` [PATCH 14/15] Input: synaptics-rmi4 - ensure we have IRQs before reading status Christopher Heiny
2014-02-05 2:40 ` Courtney Cavin
2014-02-04 23:10 ` [PATCH 13/15] Input: synaptics-rmi4 - properly set F01 container on PDT scan Christopher Heiny
2014-02-05 2:39 ` Courtney Cavin
2014-02-04 23:10 ` [PATCH 11/15] Input: synaptics-rmi4 - add regulator support Christopher Heiny
2014-02-05 2:38 ` Courtney Cavin
2014-02-04 23:10 ` [PATCH 10/15] Input: synaptics-rmi4 - add devicetree support Christopher Heiny
2014-02-05 2:37 ` Courtney Cavin
2014-02-04 23:10 ` [PATCH 09/15] Input: synaptics-rmi4 - remove unused defines and variables Christopher Heiny
2014-02-05 2:35 ` Courtney Cavin
2014-02-04 23:10 ` [PATCH 08/15] Input: synaptics-rmi4 - cleanup platform data Christopher Heiny
2014-02-05 2:34 ` Courtney Cavin
2014-02-04 23:09 ` [PATCH 07/15] Input: synaptics-rmi4 - remove remaining debugfs code Christopher Heiny
2014-02-05 2:33 ` Courtney Cavin
2014-02-04 23:09 ` [PATCH 06/15] Input: synaptics-rmi4 - remove platform suspend callbacks Christopher Heiny
2014-02-05 2:32 ` Courtney Cavin
2014-02-04 23:08 ` [PATCH 05/15] Input: synaptics-rmi4 - remove gpio handling and polling Christopher Heiny
2014-02-05 2:31 ` Courtney Cavin
2014-02-06 9:28 ` Linus Walleij
2014-02-06 20:05 ` Christopher Heiny
2014-02-07 1:45 ` Courtney Cavin
2014-02-06 20:05 ` Christopher Heiny
2014-02-07 1:47 ` Courtney Cavin
2014-02-04 23:08 ` [PATCH 04/15] Input: synaptics-rmi4 - remove sensor name from platform data Christopher Heiny
2014-02-05 2:30 ` Courtney Cavin
2014-02-04 23:08 ` [PATCH 03/15] Input: synaptics-rmi4 - don't free devices directly Christopher Heiny
2014-02-05 2:28 ` Courtney Cavin
2014-02-04 23:08 ` [PATCH 02/15] Input: synaptics-rmi4 - don't kfree devm_ alloced memory Christopher Heiny
2014-02-05 2:27 ` Courtney Cavin
2014-02-04 23:08 ` [PATCH 01/15] Input: synaptics-rmi4 - fix checkpatch.pl, sparse and GCC warnings Christopher Heiny
2014-02-05 2:26 ` Courtney Cavin
2014-02-06 1:09 ` Dmitry Torokhov
2014-02-06 1:36 ` Christopher Heiny
2014-02-13 6:36 ` Dmitry Torokhov
2014-02-13 18:56 ` Christopher Heiny
2014-02-13 19:10 ` Dmitry Torokhov
2014-02-13 19:12 ` Dmitry Torokhov
2014-02-13 19:25 ` Christopher Heiny [this message]
2014-01-24 0:06 ` [PATCH 00/15] Input: synaptics-rmi4 - cleanup and add DT support Courtney Cavin
2014-01-24 23:24 ` Christopher Heiny
2014-01-25 1:08 ` Courtney Cavin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=52FD1C2D.8050901@synaptics.com \
--to=cheiny@synaptics.com \
--cc=courtney.cavin@sonymobile.com \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).