lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 25 Oct 2011 09:38:18 +0200
From:	Ricardo Ribalda Delgado <ricardo.ribalda@...il.com>
To:	Grant Likely <grant.likely@...retlab.ca>
Cc:	dmitry.torokhov@...il.com, sameo@...ux.intel.com,
	peter.ujfalusi@...com, jic23@....ac.uk, aghayal@...eaurora.org,
	david@...deman.nu, Shubhrajyoti@...com, saaguirre@...com,
	hemanthv@...com, linux-input@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCHv4 1/6] input/cma3000_d0x: Support devices without pdata

Hello Grant

>> ---
>
> Drop this line, git cuts everything below a '---' line from the commit text.

Done, thanks

>
> This binding needs documentation before it can be merged.

Documentation/input/cma3000_d0x.txt is the right place ?

>
> No of_device_id match table to match against compatible values?

I think it is not needed, the device will be matched against the
driver cma3000_d0x_spi.c and AFAIK on the spi/i2c devices you dont
need the device_id match. But you know much more about this :).  Can
you point me to a example where a spi driver uses of_device-id match.

>
>> +
>>  struct cma3000_accl_data *cma3000_init(struct device *dev, int irq,
>>                                      const struct cma3000_bus_ops *bops)
>>  {
>> -     const struct cma3000_platform_data *pdata = dev->platform_data;
>> +     struct cma3000_platform_data *pdata;
>>       struct cma3000_accl_data *data;
>>       struct input_dev *input_dev;
>>       int rev;
>>       int error;
>>
>> -     if (!pdata) {
>> -             dev_err(dev, "platform data not found\n");
>> -             error = -EINVAL;
>> -             goto err_out;
>> -     }
>> -
>> -
>>       /* if no IRQ return error */
>>       if (irq == 0) {
>>               error = -EINVAL;
>> @@ -309,10 +357,26 @@ struct cma3000_accl_data *cma3000_init(struct device *dev, int irq,
>>               goto err_free_mem;
>>       }
>>
>> +     /*Init platform data*/
>> +     if (dev->platform_data != NULL) {
>> +             memcpy(&data->pdata, dev->platform_data, sizeof(data->pdata));
>> +     } else {
>> +             memcpy(&data->pdata, &cma3000_default_pdata,
>> +                             sizeof(data->pdata));
>> +             #ifdef CONFIG_OF
>> +             if (dev->of_node != NULL)
>> +                     cma3000_get_pdata_of(dev, data);
>> +              else
>> +                     dev_info(dev, "platform data not found, using default\n");
>> +             #else
>> +             dev_info(dev, "platform data not found, using default\n");
>> +             #endif
>> +     }
>> +     pdata = &data->pdata;
>> +
>>       data->dev = dev;
>>       data->input_dev = input_dev;
>>       data->bus_ops = bops;
>> -     data->pdata = pdata;
>>       data->irq = irq;
>>       mutex_init(&data->mutex);
>>
>> --
>> 1.7.7
>>
>



-- 
Ricardo Ribalda
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ