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] [day] [month] [year] [list]
Message-ID: <20120802101626.GE29157@opensource.wolfsonmicro.com>
Date:	Thu, 2 Aug 2012 11:16:27 +0100
From:	Mark Brown <broonie@...nsource.wolfsonmicro.com>
To:	Anthony Olech <anthony.olech.opensource@...semi.com>
Cc:	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [NEW DRIVER V1 1/7] DA9058 MFD core and ADC driver

On Thu, Aug 02, 2012 at 09:48:55AM +0100, Anthony Olech wrote:

> +#if 0
> +	return regmap_bulk_read(da9058->regmap, reg, val, val_count);
> +#else
> +	int ret = regmap_bulk_read(da9058->regmap, reg, val, val_count);
> +	return ret;
> +#endif

This shouldn't be going into mainline...

> +/*
> + *  if the PMIC is in automatic ADC consersion mode we have the choice
> + *  of just getting the last (automatic) conversion or doing a manual
> + *  conversion anyway.
> + *
> + *  if the PMIC is not in automatic ADC consersion mode we have no choice
> + *  we just have to ignore the requested mode and just do a manual
> + *  ADC conversion.
> + */
> +static int da9058_automatic_adc_conversion(struct da9058 *da9058,
> +				const int channel, int *value)

This ADC stuff should be an IIO driver now.

> +	if (pdata->init_board_irq) {
> +		ret = pdata->init_board_irq();
> +		if (ret)

Why is this conditional?  With irqdomains there's no real reason to not
allocate the IRQs even if you can't usefully use them and it helps make
the code simpler.

> +			goto err4;

Named labesl are *much* better, it's vastly less painful if you need to
add new code.

> +	da9058->reg_read = da9058_register_read;
> +	da9058->reg_write = da9058_register_write;
> +	da9058->reg_raw_read = da9058_register_raw_read;
> +	da9058->reg_raw_write = da9058_register_raw_write;
> +	da9058->reg_bulk_read = da9058_register_bulk_read;
> +	da9058->reg_bulk_write = da9058_register_bulk_write;
> +	da9058->reg_update_bits = da9058_register_update_bits;

These are always the same thing.  Just have some inline functions in the
header if you find this useful, the vtable in the driver is just
replicating what regmap does and making things more complicated.

> +int da9058_to_virt_irq_num(struct da9058 *da9058, int irq)
> +{
> +	return da9058->irq_base + irq;
> +}
> +EXPORT_SYMBOL_GPL(da9058_to_virt_irq_num);

This should be calling regmap_irq_get_virq() and a static inlinne in the
header.

> +	dev_info(da9058->dev, "IRQ %d mapped to virtual array based at %d\n",
> +			da9058->chip_irq, da9058->irq_base);

This sort of log message isn't terribly useful and isn't accurate with
irq domains.
--
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