linux-iio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
To: Lars-Peter Clausen <lars@metafoo.de>
Cc: Jonathan Cameron <jic23@kernel.org>, linux-iio@vger.kernel.org
Subject: Re: [PATCH v2 1/9] iio: hid_Sensors: fix crash during trigger unregister
Date: Thu, 24 Oct 2013 08:40:39 -0700	[thread overview]
Message-ID: <52693F77.80105@linux.intel.com> (raw)
In-Reply-To: <52693AE2.2030203@metafoo.de>

On 10/24/2013 08:21 AM, Lars-Peter Clausen wrote:
> On 10/24/2013 12:42 PM, Jonathan Cameron wrote:
>> On 10/23/13 20:11, Srinivas Pandruvada wrote:
>>> We can't store the trigger instance created by iio_trigger_alloc, in
>>> trig field of iio_device structure. This needs to be stored in the
>>> driver private data. Othewise it can result in crash during module
>>> unload. Hence created a trig_ptr in the common data structure
>>> for each HID sensor IIO driver and storing here.
>>>
>>> Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
>> Other than the use of a void * this is fine. Please fix that little issue
>> up...
>>> --- a/include/linux/hid-sensor-hub.h
>>> +++ b/include/linux/hid-sensor-hub.h
>>> @@ -184,6 +184,7 @@ struct hid_sensor_common {
>>>   	struct platform_device *pdev;
>>>   	unsigned usage_id;
>>>   	bool data_ready;
>>> +	void *trig_ptr;
>> Why a void *?  It's struct iio_trigger *
>> Just put
>> struct iio_trigger;
>> above if you want to (reasonably) avoid including the
>> header.  Don't use a void pointer unless you really have no way
>> of knowing what the type is.
> Also just 'trigger' might be a better name then 'trig_ptr'.
Will change in next patch along with the suggestions from Jonathan.

Thanks,
Srinivas
>>>   	struct hid_sensor_hub_attribute_info poll;
>>>   	struct hid_sensor_hub_attribute_info report_state;
>>>   	struct hid_sensor_hub_attribute_info power_state;
>>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-iio" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>


      reply	other threads:[~2013-10-24 15:40 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-23 19:11 [PATCH v2 1/9] iio: hid_Sensors: fix crash during trigger unregister Srinivas Pandruvada
2013-10-23 19:11 ` [PATCH v2 2/9] iio: hid-sensors: Add connection type Srinivas Pandruvada
2013-10-23 19:11 ` [PATCH v2 3/9] iio: hid-sensors: accelerometer: Add sensitivity Srinivas Pandruvada
2013-10-23 19:11 ` [PATCH v2 4/9] iio: hid-sensors: gyro : " Srinivas Pandruvada
2013-10-23 19:11 ` [PATCH v2 5/9] iio: hid-sensors: light/als " Srinivas Pandruvada
2013-10-23 19:11 ` [PATCH v2 6/9] iio: hid-sensors: magnetometer " Srinivas Pandruvada
2013-10-23 19:11 ` [PATCH v2 7/9] iio: hid-sensors: Added Inclinometer 3D Srinivas Pandruvada
2013-10-24 11:06   ` Jonathan Cameron
2013-10-24 11:11     ` Jonathan Cameron
2013-10-23 19:11 ` [PATCH v2 8/9] iio: Add channel modifiers for Quaternion Rotations Srinivas Pandruvada
2013-10-24 11:18   ` Jonathan Cameron
2013-10-24 15:17     ` Srinivas Pandruvada
2013-10-24 16:20       ` Jonathan Cameron
2013-10-28 23:44         ` Srinivas Pandruvada
2013-10-29  6:54           ` Jonathan Cameron
2013-10-23 19:11 ` [PATCH v2 9/9] iio: hid-sensors: Added device rotation support Srinivas Pandruvada
2013-10-24 10:42 ` [PATCH v2 1/9] iio: hid_Sensors: fix crash during trigger unregister Jonathan Cameron
2013-10-24 15:21   ` Lars-Peter Clausen
2013-10-24 15:40     ` Srinivas Pandruvada [this message]

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=52693F77.80105@linux.intel.com \
    --to=srinivas.pandruvada@linux.intel.com \
    --cc=jic23@kernel.org \
    --cc=lars@metafoo.de \
    --cc=linux-iio@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).