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:	Wed, 5 Sep 2012 03:32:50 +0900
From:	Taehun Kim <kth3321@...il.com>
To:	Sylwester Nawrocki <sylvester.nawrocki@...il.com>
Cc:	Ben Dooks <ben-linux@...ff.org>,
	Kukjin Kim <kgene.kim@...sung.com>,
	Russell King <linux@....linux.org.uk>,
	linux-arm-kernel@...ts.infradead.org,
	linux-samsung-soc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] ARM: S3C24XX: Add WIZnet W5300E01-ARM board support

2012/9/4 Sylwester Nawrocki <sylvester.nawrocki@...il.com>:
> On 09/03/2012 07:36 PM, Taehun Kim wrote:
>> +static void __init w5300e01_init(void)
>> +{
>> +     s3c_nand_set_platdata(&w5300e01_nand_info);
>> +     platform_add_devices(w5300e01_devices, ARRAY_SIZE(w5300e01_devices));
>> +
>> +     /* W5300 interrupt pin. */
>> +     s3c_gpio_cfgpin(S3C2410_GPF(0), S3C2410_GPIO_IRQ);
>> +
>> +     s3c_gpio_cfgpin(S3C2410_GPF(4), S3C2410_GPIO_OUTPUT);
>> +     s3c_gpio_cfgpin(S3C2410_GPF(5), S3C2410_GPIO_OUTPUT);
>> +     s3c_gpio_cfgpin(S3C2410_GPF(6), S3C2410_GPIO_OUTPUT);
>> +     s3c_gpio_cfgpin(S3C2410_GPF(7), S3C2410_GPIO_OUTPUT);
>
> Please don't use these obsolete S3C2410_GPIO_* defines, they will be
> gone soon, if aren't yet.
>
>> +     gpio_set_value(S3C2410_GPF(0), 1);
>> +     gpio_set_value(S3C2410_GPF(4), 1);
>> +     gpio_set_value(S3C2410_GPF(5), 1);
>> +     gpio_set_value(S3C2410_GPF(6), 1);
>> +     gpio_set_value(S3C2410_GPF(7), 1);
>
> Instead I would do something like:
>
> 8<-----------------------------------------------------------------
>
> static const struct gpio gpios[] = {
>         { S3C2410_GPF(4), GPIOF_OUT_INIT_HIGH, NULL },
>         { S3C2410_GPF(5), GPIOF_OUT_INIT_HIGH, NULL },
>         { S3C2410_GPF(6), GPIOF_OUT_INIT_HIGH, NULL },
>         { S3C2410_GPF(7), GPIOF_OUT_INIT_HIGH, NULL },
> };
>
> if (!WARN_ON(gpio_request_array(gpios, ARRAY_SIZE(gpios)))
>         gpios_free_array(gpios);
>
> /* W5300 interrupt pin. */
> if (!WARN_ON(gpio_request(S3C2410_GPF(0), GPIOF_IN, NULL))) {
>         s3c_gpio_cfgpin(S3C2410_GPF(0), S3C_GPIO_SFN(2)); /* EINT0 */
>         gpio_free(S3C2410_GPF(0));
> }
>
> 8<-----------------------------------------------------------------
>
> --
>
> Regards,
> Sylwester

Thank you for your feedback. I will change the gpio routine as follows:

-----------------------------------------------------------------

static const struct gpio w5300e01_gpios[] = {
	{ S3C2410_GPF(4), GPIOF_OUT_INIT_HIGH, NULL },
	{ S3C2410_GPF(5), GPIOF_OUT_INIT_HIGH, NULL },
	{ S3C2410_GPF(6), GPIOF_OUT_INIT_HIGH, NULL },
	{ S3C2410_GPF(7), GPIOF_OUT_INIT_HIGH, NULL },
};

static void __init w5300_init(void)
{
	/* W5300 interrupt pin. */
	if (WARN_ON(gpio_request(S3C2410_GPF(0), "W5300 irq"))) {
		pr_err("%s: GPIO request failed.\n", __func__);
		return;
	}
	s3c_gpio_cfgpin(S3C2410_GPF(0), S3C_GPIO_SFN(2)); /* EINT0 */
}

static void __init w5300e01_init(void)
{
	s3c_nand_set_platdata(&w5300e01_nand_info);
	platform_add_devices(w5300e01_devices, ARRAY_SIZE(w5300e01_devices));

	if (WARN_ON(gpio_request_array(w5300e01_gpios, ARRAY_SIZE(w5300e01_gpios))))
		pr_err("%s: GPIO request failed\n", __func__);

	w5300_init();
	s3c_pm_init();
}
-----------------------------------------------------------------

Does anybody have a other comments?
--
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