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]
Message-id: <54F014CC.2000605@samsung.com>
Date:	Fri, 27 Feb 2015 15:55:08 +0900
From:	Ingi Kim <ingi2.kim@...sung.com>
To:	Varka Bhadram <varkabhadram@...il.com>
Cc:	robh+dt@...nel.org, Pawel Moll <pawel.moll@....com>,
	Mark Rutland <mark.rutland@....com>,
	Ian Campbell <ijc+devicetree@...lion.org.uk>,
	Kumar Gala <galak@...eaurora.org>,
	Bryan Wu <cooloney@...il.com>, rpurdie@...ys.net,
	treding@...dia.com, Philipp Zabel <p.zabel@...gutronix.de>,
	Andrew Lunn <andrew@...n.ch>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	florian.vaussard@...l.ch, arno@...isbad.org,
	Kuninori Morimoto <kuninori.morimoto.gx@...esas.com>,
	Hayato Suzuki <hytszk@...il.com>, antonynpavlov@...il.com,
	sw0312.kim@...sung.com, ideal.song@...sung.com,
	"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	linux-leds@...r.kernel.org
Subject: Re: [PATCH 3/3] leds: Add ktd2692 flash LED driver


hi

On 2015년 02월 27일 12:36, Varka Bhadram wrote:
> On 02/27/2015 06:31 AM, Ingi Kim wrote:
>> This patch adds a driver to support the ktd2692 flash LEDs.
>> ktd2692 can control flash current by ExpressWire interface.
>>
>> Signed-off-by: Ingi Kim <ingi2.kim@...sung.com>
>> ---
>>   drivers/leds/Kconfig        |    8 ++
>>   drivers/leds/Makefile       |    1 +
>>   drivers/leds/leds-ktd2692.c |  245 +++++++++++++++++++++++++++++++++++++++++++
>>   3 files changed, 254 insertions(+)
>>   create mode 100644 drivers/leds/leds-ktd2692.c
>>
> (...)
> 
>> +static struct ktd2692_context *ktd2692_parse_dt(struct device *dev)
>> +{
>> + struct device_node *np = dev->of_node;
>> + struct ktd2692_context *led;
>> +
>> + led = devm_kzalloc(dev, sizeof(struct ktd2692_context), GFP_KERNEL);
>> + if (!led)
>> + return ERR_PTR((long)led);
> 
> What about using sizeof(*led) in place of sizeof(struct ktd2692_context)..?
> 
> Also the error return for devm_kzalloc() should be -ENOMEM.
> 

Thanks, I'll check and change sizeof() and error return style.

>> +
>> + led->strobe_gpio = of_get_named_gpio(np, "strobe-gpio", 0);
>> + if (!gpio_is_valid(led->strobe_gpio)) {
>> + dev_err(dev, "no strobe_gpio property found\n");
>> + return ERR_PTR(led->strobe_gpio);
>> + }
>> +
>> + return led;
>> +}
>> +
>> +static int ktd2692_probe(struct platform_device *pdev)
>> +{
>> + struct device *dev = &pdev->dev;
>> + struct ktd2692_context *led;
>> + int ret;
>> +
>> + if (!dev->of_node)
>> + return -ENODEV;
>> +
>> + led = ktd2692_parse_dt(dev);
>> + if (IS_ERR(led))
>> + return PTR_ERR(led);
>> +
>> + led->cdev.name = KTD2692_DEFAULT_NAME;
>> + led->cdev.brightness = LED_OFF;
>> + led->cdev.max_brightness = LED_FULL;
>> + led->cdev.flags |= LED_CORE_SUSPENDRESUME;
>> + led->cdev.brightness_set = ktd2692_brightness_set;
>> + led->cdev.brightness_get = ktd2692_brightness_get;
>> + led->mode = KTD2692_REG_MODE_BASE | KTD2692_MODE_DISABLE;
>> +
>> + platform_set_drvdata(pdev, led);
>> +
>> + ret = led_classdev_register(&pdev->dev, &led->cdev);
>> + if (ret) {
>> + dev_err(dev, "couldn't register LED %s\n", led->cdev.name);
>> + return ret;
>> + }
>> +
>> + ret = ktd2692_brightness_set_gpio(led);
>> + if (ret) {
>> + led_classdev_unregister(&led->cdev);
>> + return ret;
>> + }
>> +
>> + ktd2692_expresswire_reset(led);
>> +
>> + return ret;
> 
> return 0 instead of ret...?
> 
> 
> 

I'll check and try
Thanks,
--
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