Re: [PATCH] staging: fieldbus: make use of devm_platform_ioremap_resource
On Mon, Oct 28, 2019 at 05:11:26PM -0400, Sven Van Asbroeck wrote: > Hi Greg, friendly reminder... Did you miss the patch review below, or > is there a reason > why this isn't getting queued? > > There seems to be a crowd chasing down this type of warnings, resulting > in multiple duplicates. This has been in my tree already for a while, can you verify it is all ok? thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/2] Staging: gasket: implement apex_get_status() to check driver status
On Tue, Oct 29, 2019 at 12:59:25AM +0200, Samuil Ivanov wrote: > >From the TODO: > - apex_get_status() should actually check status > > The function now checkes the status of the driver > > Signed-off-by: Samuil Ivanov > --- > drivers/staging/gasket/apex_driver.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/drivers/staging/gasket/apex_driver.c > b/drivers/staging/gasket/apex_driver.c > index 46199c8ca441..a5dd6f3c367d 100644 > --- a/drivers/staging/gasket/apex_driver.c > +++ b/drivers/staging/gasket/apex_driver.c > @@ -247,6 +247,9 @@ module_param(bypass_top_level, int, 0644); > static int apex_get_status(struct gasket_dev *gasket_dev) > { > /* TODO: Check device status. */ > + if (gasket_dev->status == GASKET_STATUS_DEAD) > + return GASKET_STATUS_DEAD; > + Have you tested this to verify that this is what is needed here? thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 2/4] staging: KPC2000: kpc2000_spi.c: Fix style issues (misaligned brace)
Resolved: ERROR: else should follow close brace '}' Signed-off-by: Chandra Annamaneni --- Previous versions of these patches were not split into different patches, did not have different patch numbers and did not have the keyword staging. The previous version of this patch had the wrong description and subject. drivers/staging/kpc2000/kpc2000_spi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/kpc2000/kpc2000_spi.c b/drivers/staging/kpc2000/kpc2000_spi.c index 5712a88c8788..929136cdc3e1 100644 --- a/drivers/staging/kpc2000/kpc2000_spi.c +++ b/drivers/staging/kpc2000/kpc2000_spi.c @@ -226,8 +226,7 @@ kp_spi_txrx_pio(struct spi_device *spidev, struct spi_transfer *transfer) kp_spi_write_reg(cs, KP_SPI_REG_TXDATA, val); processed++; } - } - else if (rx) { + } else if (rx) { for (i = 0 ; i < c ; i++) { char test = 0; -- 2.20.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 3/4] staging: KPC2000: kpc2000_spi.c: Fix style issues (alignment)
Resolved: "CHECK: Alignment should match open parenthesis" from checkpatch Signed-off-by: Chandra Annamaneni --- Previous versions of these patches were not split into different patches, did not have different patch numbers and did not have the keyword staging. drivers/staging/kpc2000/kpc2000_spi.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/kpc2000/kpc2000_spi.c b/drivers/staging/kpc2000/kpc2000_spi.c index 929136cdc3e1..24de8d63f504 100644 --- a/drivers/staging/kpc2000/kpc2000_spi.c +++ b/drivers/staging/kpc2000/kpc2000_spi.c @@ -313,19 +313,19 @@ kp_spi_transfer_one_message(struct spi_master *master, struct spi_message *m) if (transfer->speed_hz > KP_SPI_CLK || (len && !(rx_buf || tx_buf))) { dev_dbg(kpspi->dev, " transfer: %d Hz, %d %s%s, %d bpw\n", - transfer->speed_hz, - len, - tx_buf ? "tx" : "", - rx_buf ? "rx" : "", - transfer->bits_per_word); + transfer->speed_hz, + len, + tx_buf ? "tx" : "", + rx_buf ? "rx" : "", + transfer->bits_per_word); dev_dbg(kpspi->dev, " transfer -EINVAL\n"); return -EINVAL; } if (transfer->speed_hz && transfer->speed_hz < (KP_SPI_CLK >> 15)) { dev_dbg(kpspi->dev, "speed_hz %d below minimum %d Hz\n", - transfer->speed_hz, - KP_SPI_CLK >> 15); + transfer->speed_hz, + KP_SPI_CLK >> 15); dev_dbg(kpspi->dev, " speed_hz -EINVAL\n"); return -EINVAL; } -- 2.20.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 4/4] staging: KPC2000: kpc2000_spi.c: Fix style issues (Unnecessary parenthesis)
Resolved: CHECK: Unnecessary parentheses around table[i] Signed-off-by: Chandra Annamaneni --- Previous versions of these patches were not split into different patches, did not have different patch numbers and did not have the keyword staging. drivers/staging/kpc2000/kpc2000_spi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/kpc2000/kpc2000_spi.c b/drivers/staging/kpc2000/kpc2000_spi.c index 24de8d63f504..8becf972af9c 100644 --- a/drivers/staging/kpc2000/kpc2000_spi.c +++ b/drivers/staging/kpc2000/kpc2000_spi.c @@ -476,7 +476,7 @@ kp_spi_probe(struct platform_device *pldev) /* register the slave boards */ #define NEW_SPI_DEVICE_FROM_BOARD_INFO_TABLE(table) \ for (i = 0 ; i < ARRAY_SIZE(table) ; i++) { \ - spi_new_device(master, &(table[i])); \ + spi_new_device(master, &table[i]); \ } switch ((drvdata->card_id & 0x) >> 16) { -- 2.20.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 1/4] staging: KPC2000: kpc2000_spi.c: Fix style issues (missing blank line)
Resolved: "CHECK: Please use a blank line after.." from checkpatch.pl Signed-off-by: Chandra Annamaneni --- Previous versions of these patches were not split into different patches, did not have different patch numbers and did not have the keyword staging. drivers/staging/kpc2000/kpc2000_spi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/staging/kpc2000/kpc2000_spi.c b/drivers/staging/kpc2000/kpc2000_spi.c index 6ba94b0131da..5712a88c8788 100644 --- a/drivers/staging/kpc2000/kpc2000_spi.c +++ b/drivers/staging/kpc2000/kpc2000_spi.c @@ -50,6 +50,7 @@ static struct flash_platform_data p2kr0_spi0_pdata = { .nr_parts = ARRAY_SIZE(p2kr0_spi0_parts), .parts =p2kr0_spi0_parts, }; + static struct flash_platform_data p2kr0_spi1_pdata = { .name = "SPI1", .nr_parts = ARRAY_SIZE(p2kr0_spi1_parts), -- 2.20.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: fieldbus: make use of devm_platform_ioremap_resource
On Tue, Oct 29, 2019 at 4:03 AM Greg Kroah-Hartman wrote: > > This has been in my tree already for a while, can you verify it is all > ok? > All good. I see you took Cristiane's version, not hariprasad's or YueHaibing's. As long as one version lands, all is well :) ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v3] ARM: tegra: Enable Tegra VDE driver in tegra_defconfig
On Sun, Jun 23, 2019 at 08:07:25PM +0300, Dmitry Osipenko wrote: > The video decoder driver was tested by time and works absolutely fine. > The reason why it is in staging is because it doesn't provide common V4L > interface yet, this shouldn't stop driver enabling in the defconfig since > our userspace (libvdpau-tegra) provides combined acceleration of decoding > and displaying without use of V4L. > > Signed-off-by: Dmitry Osipenko > --- > > No changes since v1. > > arch/arm/configs/tegra_defconfig | 2 ++ > 1 file changed, 2 insertions(+) Applied to for-5.5/arm/defconfig, thanks. Thierry signature.asc Description: PGP signature ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v3] ARM: dts: tegra30: Connect SMMU with Video Decoder Engine
On Sun, Jun 23, 2019 at 08:07:24PM +0300, Dmitry Osipenko wrote: > Enable IOMMU support for the video decoder. > > Signed-off-by: Dmitry Osipenko > --- > > No changes since v1. > > arch/arm/boot/dts/tegra30.dtsi | 1 + > 1 file changed, 1 insertion(+) Applied to for-5.5/arm/dt, thanks. Thierry signature.asc Description: PGP signature ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 1/4] iio: adc: Add support for AD7091R5 ADC
From: Paul Cercueil AD7091 is 4-Channel, I2C, Ultra Low Power,12-Bit ADC. Datasheet: Link: https://www.analog.com/media/en/technical-documentation/data-sheets/ad7091r-5.pdf Signed-off-by: Paul Cercueil Co-developed-by: Beniamin Bia Signed-off-by: Beniamin Bia --- Changes in v2: -blank lines removed -prefix added to macros -comments rework -error checking syntax changed -iio mutex replaced by a mutex -device remove function was removed and later replaced by devm_add_action -regmap include removed from header drivers/iio/adc/Kconfig| 7 + drivers/iio/adc/Makefile | 1 + drivers/iio/adc/ad7091r-base.c | 264 + drivers/iio/adc/ad7091r-base.h | 25 drivers/iio/adc/ad7091r5.c | 102 + 5 files changed, 399 insertions(+) create mode 100644 drivers/iio/adc/ad7091r-base.c create mode 100644 drivers/iio/adc/ad7091r-base.h create mode 100644 drivers/iio/adc/ad7091r5.c diff --git a/drivers/iio/adc/Kconfig b/drivers/iio/adc/Kconfig index 7e3286265a38..80b1b9551749 100644 --- a/drivers/iio/adc/Kconfig +++ b/drivers/iio/adc/Kconfig @@ -22,6 +22,13 @@ config AD7124 To compile this driver as a module, choose M here: the module will be called ad7124. +config AD7091R5 + tristate "Analog Devices AD7091R5 ADC Driver" + depends on I2C + select REGMAP_I2C + help + Say yes here to build support for Analog Devices AD7091R-5 ADC. + config AD7266 tristate "Analog Devices AD7265/AD7266 ADC driver" depends on SPI_MASTER diff --git a/drivers/iio/adc/Makefile b/drivers/iio/adc/Makefile index ef9cc485fb67..55e44735aaac 100644 --- a/drivers/iio/adc/Makefile +++ b/drivers/iio/adc/Makefile @@ -6,6 +6,7 @@ # When adding new entries keep the list in alphabetical order obj-$(CONFIG_AD_SIGMA_DELTA) += ad_sigma_delta.o obj-$(CONFIG_AD7124) += ad7124.o +obj-$(CONFIG_AD7091R5) += ad7091r5.o ad7091r-base.o obj-$(CONFIG_AD7266) += ad7266.o obj-$(CONFIG_AD7291) += ad7291.o obj-$(CONFIG_AD7298) += ad7298.o diff --git a/drivers/iio/adc/ad7091r-base.c b/drivers/iio/adc/ad7091r-base.c new file mode 100644 index ..c2500f614d54 --- /dev/null +++ b/drivers/iio/adc/ad7091r-base.c @@ -0,0 +1,264 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * AD7091RX Analog to Digital converter driver + * + * Copyright 2014-2019 Analog Devices Inc. + */ + +#include +#include +#include +#include +#include +#include + +#include "ad7091r-base.h" + +#define AD7091R_REG_RESULT 0 +#define AD7091R_REG_CHANNEL 1 +#define AD7091R_REG_CONF2 +#define AD7091R_REG_ALERT 3 +#define AD7091R_REG_CH_LOW_LIMIT(ch) ((ch) * 3 + 4) +#define AD7091R_REG_CH_HIGH_LIMIT(ch) ((ch) * 3 + 5) +#define AD7091R_REG_CH_HYSTERESIS(ch) ((ch) * 3 + 6) + +/* AD7091R_REG_RESULT */ +#define AD7091R_REG_RESULT_CH_ID(x)(((x) >> 13) & 0x3) +#define AD7091R_REG_RESULT_CONV_RESULT(x) ((x) & 0xfff) + +/* AD7091R_REG_CONF */ +#define AD7091R_REG_CONF_AUTO BIT(8) +#define AD7091R_REG_CONF_CMDBIT(10) + +#define AD7091R_REG_CONF_MODE_MASK \ + (AD7091R_REG_CONF_AUTO | AD7091R_REG_CONF_CMD) + +enum ad7091r_mode { + AD7091R_MODE_SAMPLE, + AD7091R_MODE_COMMAND, + AD7091R_MODE_AUTOCYCLE, +}; + +struct ad7091r_state { + struct device *dev; + struct regmap *map; + const struct ad7091r_chip_info *chip_info; + enum ad7091r_mode mode; + struct mutex lock; +}; + +static int ad7091r_set_mode(struct ad7091r_state *st, enum ad7091r_mode mode) +{ + int ret; + + switch (mode) { + case AD7091R_MODE_SAMPLE: + ret = regmap_update_bits(st->map, AD7091R_REG_CONF, +AD7091R_REG_CONF_MODE_MASK, 0); + break; + case AD7091R_MODE_COMMAND: + ret = regmap_update_bits(st->map, AD7091R_REG_CONF, +AD7091R_REG_CONF_MODE_MASK, +AD7091R_REG_CONF_CMD); + break; + case AD7091R_MODE_AUTOCYCLE: + ret = regmap_update_bits(st->map, AD7091R_REG_CONF, +AD7091R_REG_CONF_MODE_MASK, +AD7091R_REG_CONF_AUTO); + break; + default: + ret = -EINVAL; + break; + } + + if (ret) + return ret; + + st->mode = mode; + + return ret; +} + +static int ad7091r_set_channel(struct ad7091r_state *st, unsigned int channel) +{ + unsigned int foo; + int ret; + + /* AD7091R_REG_CHANNEL specified which channels to be converted */ + ret = regmap_write(st->map, AD7091R_REG_CHANNEL, + BIT(channel) | (BIT(channel) << 8)); + if (ret) + return ret; + + /* +* There is a latency of one conversion before the channel conversion +* sequence is updated +*/ + return regmap
[PATCH v2 2/4] iio: adc: ad7091r5: Add scale and external VREF support
From: Paul Cercueil The scale can now be obtained with the "in_voltage_scale" file. By default, the scale returned corresponds to the internal VREF of 2.5V. It is possible to use an external VREF (through the REFIN/REFOUT pin of the chip), by passing a regulator to the driver. The scale will then be calculated according to the voltage reported by the regulator. Signed-off-by: Paul Cercueil Co-developed-by: Beniamin Bia Signed-off-by: Beniamin Bia --- Changes in v2: -device remove function replaced by devm_add_action_or_reset drivers/iio/adc/ad7091r-base.c | 41 ++ drivers/iio/adc/ad7091r-base.h | 1 + drivers/iio/adc/ad7091r5.c | 5 + 3 files changed, 47 insertions(+) diff --git a/drivers/iio/adc/ad7091r-base.c b/drivers/iio/adc/ad7091r-base.c index c2500f614d54..fda1112e7376 100644 --- a/drivers/iio/adc/ad7091r-base.c +++ b/drivers/iio/adc/ad7091r-base.c @@ -11,6 +11,7 @@ #include #include #include +#include #include "ad7091r-base.h" @@ -42,6 +43,7 @@ enum ad7091r_mode { struct ad7091r_state { struct device *dev; struct regmap *map; + struct regulator *reg; const struct ad7091r_chip_info *chip_info; enum ad7091r_mode mode; struct mutex lock; @@ -145,6 +147,21 @@ static int ad7091r_read_raw(struct iio_dev *iio_dev, ret = IIO_VAL_INT; break; + case IIO_CHAN_INFO_SCALE: + if (st->reg) { + ret = regulator_get_voltage(st->reg); + if (ret < 0) + goto unlock; + + *val = ret / 1000; + } else { + *val = st->chip_info->vref_mV; + } + + *val2 = chan->scan_type.realbits; + ret = IIO_VAL_FRACTIONAL_LOG2; + break; + default: ret = -EINVAL; break; @@ -187,6 +204,16 @@ static irqreturn_t ad7091r_event_handler(int irq, void *private) return IRQ_HANDLED; } +void ad7091r_remove(void *data) +{ + struct ad7091r_state *st; + + st = (struct ad7091r_state *)data; + + if (st->reg) + regulator_disable(st->reg); +} + int ad7091r_probe(struct device *dev, const char *name, const struct ad7091r_chip_info *chip_info, struct regmap *map, int irq) @@ -220,6 +247,20 @@ int ad7091r_probe(struct device *dev, const char *name, return ret; } + st->reg = devm_regulator_get_optional(dev, "vref"); + if (IS_ERR(st->reg)) { + if (PTR_ERR(st->reg) == EPROBE_DEFER) + return -EPROBE_DEFER; + + st->reg = NULL; + } else { + ret = regulator_enable(st->reg); + if (ret) + return ret; + } + + devm_add_action_or_reset(dev, ad7091r_remove, st); + /* Use command mode by default to convert only desired channels*/ ret = ad7091r_set_mode(st, AD7091R_MODE_COMMAND); if (ret < 0) diff --git a/drivers/iio/adc/ad7091r-base.h b/drivers/iio/adc/ad7091r-base.h index 5f1147735953..76b76968d071 100644 --- a/drivers/iio/adc/ad7091r-base.h +++ b/drivers/iio/adc/ad7091r-base.h @@ -14,6 +14,7 @@ struct ad7091r_state; struct ad7091r_chip_info { unsigned int num_channels; const struct iio_chan_spec *channels; + unsigned int vref_mV; }; extern const struct regmap_config ad7091r_regmap_config; diff --git a/drivers/iio/adc/ad7091r5.c b/drivers/iio/adc/ad7091r5.c index 2c44dd02ba1a..7ee4a781cc01 100644 --- a/drivers/iio/adc/ad7091r5.c +++ b/drivers/iio/adc/ad7091r5.c @@ -35,10 +35,13 @@ static const struct iio_event_spec ad7091r5_events[] = { #define AD7091R_CHANNEL(idx, bits, ev, num_ev) { \ .type = IIO_VOLTAGE, \ .info_mask_separate = BIT(IIO_CHAN_INFO_RAW), \ + .info_mask_shared_by_type = BIT(IIO_CHAN_INFO_SCALE), \ .indexed = 1, \ .channel = idx, \ .event_spec = ev, \ .num_event_specs = num_ev, \ + .scan_type.storagebits = 16, \ + .scan_type.realbits = bits, \ } static const struct iio_chan_spec ad7091r5_channels_irq[] = { AD7091R_CHANNEL(0, 12, ad7091r5_events, ARRAY_SIZE(ad7091r5_events)), @@ -58,11 +61,13 @@ static const struct iio_chan_spec ad7091r5_channels_noirq[] = { static const struct ad7091r_chip_info ad7091r5_chip_info_irq = { .channels = ad7091r5_channels_irq, .num_channels = ARRAY_SIZE(ad7091r5_channels_irq), + .vref_mV = 2500, }; static const struct ad7091r_chip_info ad7091r5_chip_info_noirq = { .channels = ad7091r5_channels_noirq, .num_channels = ARRAY_SIZE(ad7091r5_channels_noirq), + .vref_mV = 2500, }; static int ad7091r5_i2c_probe(struct i2c_client *i2c, -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org
[PATCH v2 3/4] dt-binding: iio: Add documentation for AD7091R5
Documentation for AD7091R5 ADC was added. Signed-off-by: Beniamin Bia --- Changes in v2: -nothing changed .../bindings/iio/adc/adi,ad7091r5.yaml| 53 +++ 1 file changed, 53 insertions(+) create mode 100644 Documentation/devicetree/bindings/iio/adc/adi,ad7091r5.yaml diff --git a/Documentation/devicetree/bindings/iio/adc/adi,ad7091r5.yaml b/Documentation/devicetree/bindings/iio/adc/adi,ad7091r5.yaml new file mode 100644 index ..d041cd76804e --- /dev/null +++ b/Documentation/devicetree/bindings/iio/adc/adi,ad7091r5.yaml @@ -0,0 +1,53 @@ +# SPDX-License-Identifier: GPL-2.0 +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/iio/adc/adi,ad7091r5.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Analog Devices AD7091R5 4-Channel 12-Bit ADC + +maintainers: + - Beniamin Bia + +description: | + Analog Devices AD7091R5 4-Channel 12-Bit ADC + https://www.analog.com/media/en/technical-documentation/data-sheets/ad7091r-5.pdf + +properties: + compatible: +enum: + - adi,ad7091R5 + + reg: +maxItems: 1 + + avcc-supply: +description: + Phandle to the Avcc power supply +maxItems: 1 + + interrupts: +maxItems: 1 + + +required: + - compatible + - reg + +examples: + - | +#include +#include +i2c { +#address-cells = <1>; +#size-cells = <0>; + +adc@0 { +compatible = "adi,ad7091r5"; +reg = <0x2F>; + +interrupts = <25 IRQ_TYPE_EDGE_FALLING>; +interrupt-parent = <&gpio>; +}; +}; +... -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 4/4] MAINTAINERS: add entry for AD7091R5 driver
Add Beniamin Bia as a maintainer for AD7091R5 ADC. Signed-off-by: Beniamin Bia --- Changes in v2: -nothing changed MAINTAINERS | 8 1 file changed, 8 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index 2e01d0f0b0e5..7f1e4b88688f 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -893,6 +893,14 @@ S: Supported F: drivers/iio/dac/ad5758.c F: Documentation/devicetree/bindings/iio/dac/ad5758.txt +ANALOG DEVICES INC AD7091R5 DRIVER +M: Beniamin Bia +L: linux-...@vger.kernel.org +W: http://ez.analog.com/community/linux-device-drivers +S: Supported +F: drivers/iio/adc/ad7091r5.c +F: Documentation/devicetree/bindings/iio/adc/adi,ad7091r5.yaml + ANALOG DEVICES INC AD7124 DRIVER M: Stefan Popa L: linux-...@vger.kernel.org -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 1/3] staging: rts5208: Eliminate the use of Camel Case in files ms
Cleans up checks of "Avoid CamelCase" in file ms.h and ms.c Signed-off-by: Gabriela Bittencourt --- drivers/staging/rts5208/ms.c | 86 ++-- drivers/staging/rts5208/ms.h | 70 ++--- 2 files changed, 78 insertions(+), 78 deletions(-) diff --git a/drivers/staging/rts5208/ms.c b/drivers/staging/rts5208/ms.c index e853fa9cc950..5c7c13dfefa0 100644 --- a/drivers/staging/rts5208/ms.c +++ b/drivers/staging/rts5208/ms.c @@ -590,7 +590,7 @@ static int ms_identify_media_type(struct rtsx_chip *chip, int switch_8bit_bus) int retval, i; u8 val; - retval = ms_set_rw_reg_addr(chip, Pro_StatusReg, 6, SystemParm, 1); + retval = ms_set_rw_reg_addr(chip, pro_status_reg, 6, system_parm, 1); if (retval != STATUS_SUCCESS) return STATUS_FAIL; @@ -840,7 +840,7 @@ static int msxc_change_power(struct rtsx_chip *chip, u8 mode) ms_cleanup_work(chip); - retval = ms_set_rw_reg_addr(chip, 0, 0, Pro_DataCount1, 6); + retval = ms_set_rw_reg_addr(chip, 0, 0, pro_data_count1, 6); if (retval != STATUS_SUCCESS) return STATUS_FAIL; @@ -885,7 +885,7 @@ static int ms_read_attribute_info(struct rtsx_chip *chip) int found_sys_info = 0, found_model_name = 0; #endif - retval = ms_set_rw_reg_addr(chip, Pro_IntReg, 2, Pro_SystemParm, 7); + retval = ms_set_rw_reg_addr(chip, pro_int_REG, 2, pro_system_parm, 7); if (retval != STATUS_SUCCESS) return STATUS_FAIL; @@ -1232,7 +1232,7 @@ static int ms_read_status_reg(struct rtsx_chip *chip) int retval; u8 val[2]; - retval = ms_set_rw_reg_addr(chip, StatusReg0, 2, 0, 0); + retval = ms_set_rw_reg_addr(chip, status_reg0, 2, 0, 0); if (retval != STATUS_SUCCESS) return STATUS_FAIL; @@ -1255,8 +1255,8 @@ static int ms_read_extra_data(struct rtsx_chip *chip, int retval, i; u8 val, data[10]; - retval = ms_set_rw_reg_addr(chip, OverwriteFlag, MS_EXTRA_SIZE, - SystemParm, 6); + retval = ms_set_rw_reg_addr(chip, overwrite_flag, MS_EXTRA_SIZE, + system_parm, 6); if (retval != STATUS_SUCCESS) return STATUS_FAIL; @@ -1307,8 +1307,8 @@ static int ms_read_extra_data(struct rtsx_chip *chip, if (retval != STATUS_SUCCESS) return STATUS_FAIL; - retval = ms_set_rw_reg_addr(chip, OverwriteFlag, - MS_EXTRA_SIZE, SystemParm, + retval = ms_set_rw_reg_addr(chip, overwrite_flag, + MS_EXTRA_SIZE, system_parm, 6); if (retval != STATUS_SUCCESS) return STATUS_FAIL; @@ -1339,8 +1339,8 @@ static int ms_write_extra_data(struct rtsx_chip *chip, u16 block_addr, if (!buf || (buf_len < MS_EXTRA_SIZE)) return STATUS_FAIL; - retval = ms_set_rw_reg_addr(chip, OverwriteFlag, MS_EXTRA_SIZE, - SystemParm, 6 + MS_EXTRA_SIZE); + retval = ms_set_rw_reg_addr(chip, overwrite_flag, MS_EXTRA_SIZE, + system_parm, 6 + MS_EXTRA_SIZE); if (retval != STATUS_SUCCESS) return STATUS_FAIL; @@ -1392,8 +1392,8 @@ static int ms_read_page(struct rtsx_chip *chip, u16 block_addr, u8 page_num) int retval; u8 val, data[6]; - retval = ms_set_rw_reg_addr(chip, OverwriteFlag, MS_EXTRA_SIZE, - SystemParm, 6); + retval = ms_set_rw_reg_addr(chip, overwrite_flag, MS_EXTRA_SIZE, + system_parm, 6); if (retval != STATUS_SUCCESS) return STATUS_FAIL; @@ -1465,8 +1465,8 @@ static int ms_set_bad_block(struct rtsx_chip *chip, u16 phy_blk) if (retval != STATUS_SUCCESS) return STATUS_FAIL; - retval = ms_set_rw_reg_addr(chip, OverwriteFlag, MS_EXTRA_SIZE, - SystemParm, 7); + retval = ms_set_rw_reg_addr(chip, overwrite_flag, MS_EXTRA_SIZE, + system_parm, 7); if (retval != STATUS_SUCCESS) return STATUS_FAIL; @@ -1519,8 +1519,8 @@ static int ms_erase_block(struct rtsx_chip *chip, u16 phy_blk) int retval, i = 0; u8 val, data[6]; - retval = ms_set_rw_reg_addr(chip, OverwriteFlag, MS_EXTRA_SIZE, - SystemParm, 6); + retval = ms_set_rw_reg_addr(chip, overwrite_flag, MS_EXTRA_SIZE, + system_parm, 6); if (retval != STATUS_SUCCESS) return STATUS_FAIL; @@ -1579,7 +1579,7 @@ static void ms_set_page_status(u1
[PATCH v2 0/3] staging: rts5208: Eliminate the use of Camel Case
Cleans up checks of "Avoid CamelCase" in tree rts5208 Gabriela Bittencourt (3): staging: rts5208: Eliminate the use of Camel Case in files ms staging: rts5208: Eliminate the use of Camel Case in files xd staging: rts5208: Eliminate the use of Camel Case in file sd.h drivers/staging/rts5208/ms.c | 86 ++-- drivers/staging/rts5208/ms.h | 70 ++--- drivers/staging/rts5208/sd.h | 2 +- drivers/staging/rts5208/xd.c | 8 ++-- drivers/staging/rts5208/xd.h | 6 +-- 5 files changed, 86 insertions(+), 86 deletions(-) -- 2.20.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 2/3] staging: rts5208: Eliminate the use of Camel Case in files xd
Cleans up checks of "Avoid CamelCase" in file xd.h and xd.c Signed-off-by: Gabriela Bittencourt --- drivers/staging/rts5208/xd.c | 8 drivers/staging/rts5208/xd.h | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/rts5208/xd.c b/drivers/staging/rts5208/xd.c index f3dc96a4c59d..0f369935fb6c 100644 --- a/drivers/staging/rts5208/xd.c +++ b/drivers/staging/rts5208/xd.c @@ -630,13 +630,13 @@ static int reset_xd(struct rtsx_chip *chip) xd_card->zone_cnt = 32; xd_card->capacity = 1024000; break; - case xD_1G_X8_512: + case XD_1G_X8_512: XD_PAGE_512(xd_card); xd_card->addr_cycle = 4; xd_card->zone_cnt = 64; xd_card->capacity = 2048000; break; - case xD_2G_X8_512: + case XD_2G_X8_512: XD_PAGE_512(xd_card); xd_card->addr_cycle = 4; xd_card->zone_cnt = 128; @@ -669,10 +669,10 @@ static int reset_xd(struct rtsx_chip *chip) return STATUS_FAIL; } - retval = xd_read_id(chip, READ_xD_ID, id_buf, 4); + retval = xd_read_id(chip, READ_XD_ID, id_buf, 4); if (retval != STATUS_SUCCESS) return STATUS_FAIL; - dev_dbg(rtsx_dev(chip), "READ_xD_ID: 0x%x 0x%x 0x%x 0x%x\n", + dev_dbg(rtsx_dev(chip), "READ_XD_ID: 0x%x 0x%x 0x%x 0x%x\n", id_buf[0], id_buf[1], id_buf[2], id_buf[3]); if (id_buf[2] != XD_ID_CODE) return STATUS_FAIL; diff --git a/drivers/staging/rts5208/xd.h b/drivers/staging/rts5208/xd.h index 57b94129b26f..98c00f268e56 100644 --- a/drivers/staging/rts5208/xd.h +++ b/drivers/staging/rts5208/xd.h @@ -36,7 +36,7 @@ #defineBLK_ERASE_1 0x60 #defineBLK_ERASE_2 0xD0 #define READ_STS 0x70 -#define READ_xD_ID 0x9A +#define READ_XD_ID 0x9A #defineCOPY_BACK_512 0x8A #defineCOPY_BACK_2K0x85 #defineREAD1_1_2 0x30 @@ -72,8 +72,8 @@ #defineXD_128M_X16_20480xC1 #defineXD_4M_X8_512_1 0xE3 #defineXD_4M_X8_512_2 0xE5 -#definexD_1G_X8_5120xD3 -#definexD_2G_X8_5120xD5 +#defineXD_1G_X8_5120xD3 +#defineXD_2G_X8_5120xD5 #defineXD_ID_CODE 0xB5 -- 2.20.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 3/3] staging: rts5208: Eliminate the use of Camel Case in file sd.h
Cleans up checks of "Avoid CamelCase" in file sd.h Signed-off-by: Gabriela Bittencourt --- drivers/staging/rts5208/sd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rts5208/sd.h b/drivers/staging/rts5208/sd.h index dc9e8cad7a74..f4ff62653b56 100644 --- a/drivers/staging/rts5208/sd.h +++ b/drivers/staging/rts5208/sd.h @@ -232,7 +232,7 @@ #define DCM_LOW_FREQUENCY_MODE 0x01 #define DCM_HIGH_FREQUENCY_MODE_SET 0x0C -#define DCM_Low_FREQUENCY_MODE_SET 0x00 +#define DCM_LOW_FREQUENCY_MODE_SET 0x00 #define MULTIPLY_BY_10x00 #define MULTIPLY_BY_20x01 -- 2.20.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/2] Staging: gasket: implement apex_get_status() to check driver status
On Tue, Oct 29, 2019 at 09:10:07AM +0100, Greg KH wrote: > On Tue, Oct 29, 2019 at 12:59:25AM +0200, Samuil Ivanov wrote: > > >From the TODO: > > - apex_get_status() should actually check status > > > > The function now checkes the status of the driver > > > > Signed-off-by: Samuil Ivanov > > --- > > drivers/staging/gasket/apex_driver.c | 3 +++ > > 1 file changed, 3 insertions(+) > > > > diff --git a/drivers/staging/gasket/apex_driver.c > > b/drivers/staging/gasket/apex_driver.c > > index 46199c8ca441..a5dd6f3c367d 100644 > > --- a/drivers/staging/gasket/apex_driver.c > > +++ b/drivers/staging/gasket/apex_driver.c > > @@ -247,6 +247,9 @@ module_param(bypass_top_level, int, 0644); > > static int apex_get_status(struct gasket_dev *gasket_dev) > > { > > /* TODO: Check device status. */ > > + if (gasket_dev->status == GASKET_STATUS_DEAD) > > + return GASKET_STATUS_DEAD; > > + > > Have you tested this to verify that this is what is needed here? > > thanks, > > greg k-h Hello Greg, After going through the code again, I am sure this not what is needed here. I thought that gasket_dev->status is already set to either GASKET_STATUS_ALIVE of GASKET_STATUS_DEAD, and all I needed to do is check it. It turns out that status has to be set before that. So what I found is that function gasket_get_hw_status() in file gasket_core.c is used to determine the health of the Gasket device, and other function use it to set gasket_dev->status and then check the device status. I think it should be something like this. ... gasket_dev->status = gasket_get_hw_status(gasket_dev); if (gasket_dev->status == GASKET_STATUS_DEAD) { dev_dbg(gasket_dev->dev, "Device reported as dead.\n"); return -EINVAL; } return GASKET_STATUS_ALIVE; ... I can try this, but I have no means of testing it. Grt, Samuil ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 3/4] dt-binding: iio: Add documentation for AD7091R5
On Mon, Oct 21, 2019 at 08:06:07PM +0300, Beniamin Bia wrote: > Documentation for AD7091R5 ADC was added. > > Signed-off-by: Beniamin Bia > --- > .../bindings/iio/adc/adi,ad7091r5.yaml| 53 +++ > 1 file changed, 53 insertions(+) > create mode 100644 > Documentation/devicetree/bindings/iio/adc/adi,ad7091r5.yaml > > diff --git a/Documentation/devicetree/bindings/iio/adc/adi,ad7091r5.yaml > b/Documentation/devicetree/bindings/iio/adc/adi,ad7091r5.yaml > new file mode 100644 > index ..d041cd76804e > --- /dev/null > +++ b/Documentation/devicetree/bindings/iio/adc/adi,ad7091r5.yaml > @@ -0,0 +1,53 @@ > +# SPDX-License-Identifier: GPL-2.0 (GPL-2.0-only OR BSD-2-Clause) for new bindings please. > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/iio/adc/adi,ad7091r5.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Analog Devices AD7091R5 4-Channel 12-Bit ADC > + > +maintainers: > + - Beniamin Bia > + > +description: | > + Analog Devices AD7091R5 4-Channel 12-Bit ADC > + > https://www.analog.com/media/en/technical-documentation/data-sheets/ad7091r-5.pdf > + > +properties: > + compatible: > +enum: > + - adi,ad7091R5 lowercase 'r' or be consistent with the filename. > + > + reg: > +maxItems: 1 > + > + avcc-supply: > +description: > + Phandle to the Avcc power supply > +maxItems: 1 Not an array, so you can drop this. > + > + interrupts: > +maxItems: 1 > + > + > +required: > + - compatible > + - reg Add: additionalProperties: false > + > +examples: > + - | > +#include > +#include > +i2c { > +#address-cells = <1>; > +#size-cells = <0>; > + > +adc@0 { adc@2f > +compatible = "adi,ad7091r5"; Doesn't match the schema. > +reg = <0x2F>; Lowercase hex. > + > +interrupts = <25 IRQ_TYPE_EDGE_FALLING>; > +interrupt-parent = <&gpio>; > +}; > +}; > +... > -- > 2.17.1 > ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: fieldbus: anybuss: use devm_platform_ioremap_resource helper
On Sat, Oct 26, 2019 at 7:52 PM Cristiane Naves wrote: > > Use devm_platform_ioremap_resource helper which wraps > platform_get_resource() and devm_ioremap_resource() together. Issue > found by coccicheck. > > Signed-off-by: Cristiane Naves > --- > drivers/staging/fieldbus/anybuss/arcx-anybus.c | 8 ++-- > 1 file changed, 2 insertions(+), 6 deletions(-) > Reviewed-by: Sven Van Asbroeck Tested-by: Sven Van Asbroeck Greg has already queued this patch, but the link embedded in his commit message should point people here. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 1/4] iio: adc: Add support for AD7091R5 ADC
It looks like you're going to have to respin the patchset so I'm adding my nits even though it's a bit late. > +static int ad7091r_set_mode(struct ad7091r_state *st, enum ad7091r_mode mode) > +{ > + int ret; > + > + switch (mode) { > + case AD7091R_MODE_SAMPLE: > + ret = regmap_update_bits(st->map, AD7091R_REG_CONF, > + AD7091R_REG_CONF_MODE_MASK, 0); > + break; > + case AD7091R_MODE_COMMAND: > + ret = regmap_update_bits(st->map, AD7091R_REG_CONF, > + AD7091R_REG_CONF_MODE_MASK, > + AD7091R_REG_CONF_CMD); > + break; > + case AD7091R_MODE_AUTOCYCLE: > + ret = regmap_update_bits(st->map, AD7091R_REG_CONF, > + AD7091R_REG_CONF_MODE_MASK, > + AD7091R_REG_CONF_AUTO); > + break; > + default: > + ret = -EINVAL; > + break; > + } This would look even better as: switch (mode) { case AD7091R_MODE_SAMPLE: conf = 0; break; case AD7091R_MODE_COMMAND: conf = AD7091R_REG_CONF_CMD; break; case AD7091R_MODE_AUTOCYCLE: conf = AD7091R_REG_CONF_AUTO; break; default: return -EINVAL; } ret = regmap_update_bits(st->map, AD7091R_REG_CONF, AD7091R_REG_CONF_MODE_MASK, conf); if (ret) return ret; st->mode = mode; return 0; > +int ad7091r_probe(struct device *dev, const char *name, > + const struct ad7091r_chip_info *chip_info, > + struct regmap *map, int irq) > +{ > + struct iio_dev *iio_dev; > + struct ad7091r_state *st; > + int ret; > + > + iio_dev = devm_iio_device_alloc(dev, sizeof(*st)); > + if (!iio_dev) > + return -ENOMEM; > + > + st = iio_priv(iio_dev); > + st->dev = dev; > + st->chip_info = chip_info; > + st->map = map; > + > + iio_dev->dev.parent = dev; > + iio_dev->name = name; > + iio_dev->info = &ad7091r_info; > + iio_dev->modes = INDIO_DIRECT_MODE; > + > + iio_dev->num_channels = chip_info->num_channels; > + iio_dev->channels = chip_info->channels; > + > + if (irq) { > + ret = devm_request_threaded_irq(dev, irq, NULL, > + ad7091r_event_handler, > + IRQF_TRIGGER_FALLING | IRQF_ONESHOT, name, st); > + if (ret) > + return ret; > + } > + > + /* Use command mode by default to convert only desired channels*/ > + ret = ad7091r_set_mode(st, AD7091R_MODE_COMMAND); > + if (ret < 0) if (ret) { > + return ret; > + > + return iio_device_register(iio_dev); > +} > +EXPORT_SYMBOL_GPL(ad7091r_probe); [ snip ] > +#include > +#include > +#include > +#include > + > +#include "ad7091r-base.h" > + > +static const struct iio_event_spec ad7091r5_events[] = { > + { > + .type = IIO_EV_TYPE_THRESH, > + .dir = IIO_EV_DIR_RISING, > + .mask_separate = BIT(IIO_EV_INFO_VALUE) | > + BIT(IIO_EV_INFO_ENABLE), This would be more clear if it were aligned like so: .mask_separate = BIT(IIO_EV_INFO_VALUE) | BIT(IIO_EV_INFO_ENABLE), > + }, > + { > + .type = IIO_EV_TYPE_THRESH, > + .dir = IIO_EV_DIR_FALLING, > + .mask_separate = BIT(IIO_EV_INFO_VALUE) | > + BIT(IIO_EV_INFO_ENABLE), .mask_separate = BIT(IIO_EV_INFO_VALUE) | BIT(IIO_EV_INFO_ENABLE), > + }, > + { > + .type = IIO_EV_TYPE_THRESH, > + .dir = IIO_EV_DIR_EITHER, > + .mask_separate = BIT(IIO_EV_INFO_HYSTERESIS), > + }, > +}; > + regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: fieldbus: anybuss: use devm_platform_ioremap_resource helper
On Tue, Oct 29, 2019 at 01:40:08PM -0400, Sven Van Asbroeck wrote: > On Sat, Oct 26, 2019 at 7:52 PM Cristiane Naves > wrote: > > > > Use devm_platform_ioremap_resource helper which wraps > > platform_get_resource() and devm_ioremap_resource() together. Issue > > found by coccicheck. > > > > Signed-off-by: Cristiane Naves > > --- > > drivers/staging/fieldbus/anybuss/arcx-anybus.c | 8 ++-- > > 1 file changed, 2 insertions(+), 6 deletions(-) > > > > Reviewed-by: Sven Van Asbroeck > Tested-by: Sven Van Asbroeck > > Greg has already queued this patch, but the link embedded in > his commit message should point people here. Thanks, I'll check it out. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: vt6655: Fix lines ending with parentheses
Fix lines ending with parentheses. Issue found by checkpatch. Signed-off-by: Cristiane Naves --- drivers/staging/vt6655/card.c | 24 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/drivers/staging/vt6655/card.c b/drivers/staging/vt6655/card.c index eba4ee0..e65c982 100644 --- a/drivers/staging/vt6655/card.c +++ b/drivers/staging/vt6655/card.c @@ -79,14 +79,10 @@ static void s_vCalculateOFDMRParameter(unsigned char byRate, u8 bb_type, * * Return Value: none */ -static -void -s_vCalculateOFDMRParameter( - unsigned char byRate, - u8 bb_type, - unsigned char *pbyTxRate, - unsigned char *pbyRsvTime -) +static void s_vCalculateOFDMRParameter(unsigned char byRate, + u8 bb_type, + unsigned char *pbyTxRate, + unsigned char *pbyRsvTime) { switch (byRate) { case RATE_6M: @@ -736,8 +732,7 @@ void CARDvSetRSPINF(struct vnt_private *priv, u8 bb_type) VNSvOutPortW(priv->PortOffset + MAC_REG_RSPINF_A_24, MAKEWORD(byTxRate, byRsvTime)); /* RSPINF_a_36 */ - s_vCalculateOFDMRParameter(CARDwGetOFDMControlRate( - (void *)priv, + s_vCalculateOFDMRParameter(CARDwGetOFDMControlRate((void *)priv, RATE_36M), bb_type, &byTxRate, @@ -745,8 +740,7 @@ void CARDvSetRSPINF(struct vnt_private *priv, u8 bb_type) VNSvOutPortW(priv->PortOffset + MAC_REG_RSPINF_A_36, MAKEWORD(byTxRate, byRsvTime)); /* RSPINF_a_48 */ - s_vCalculateOFDMRParameter(CARDwGetOFDMControlRate( - (void *)priv, + s_vCalculateOFDMRParameter(CARDwGetOFDMControlRate((void *)priv, RATE_48M), bb_type, &byTxRate, @@ -754,8 +748,7 @@ void CARDvSetRSPINF(struct vnt_private *priv, u8 bb_type) VNSvOutPortW(priv->PortOffset + MAC_REG_RSPINF_A_48, MAKEWORD(byTxRate, byRsvTime)); /* RSPINF_a_54 */ - s_vCalculateOFDMRParameter(CARDwGetOFDMControlRate( - (void *)priv, + s_vCalculateOFDMRParameter(CARDwGetOFDMControlRate((void *)priv, RATE_54M), bb_type, &byTxRate, @@ -763,8 +756,7 @@ void CARDvSetRSPINF(struct vnt_private *priv, u8 bb_type) VNSvOutPortW(priv->PortOffset + MAC_REG_RSPINF_A_54, MAKEWORD(byTxRate, byRsvTime)); /* RSPINF_a_72 */ - s_vCalculateOFDMRParameter(CARDwGetOFDMControlRate( - (void *)priv, + s_vCalculateOFDMRParameter(CARDwGetOFDMControlRate((void *)priv, RATE_54M), bb_type, &byTxRate, -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 0/2] staging: sm750fb: Fixing codestyle error
Fixing typo and usage of spaces/tabs in file sm750_accel.c Gabriela Bittencourt (2): staging: sm750fb: Fix typo in comment staging: sm750fb: Replace multiple spaces with tabs when it suits drivers/staging/sm750fb/sm750_accel.c | 22 +++--- 1 file changed, 11 insertions(+), 11 deletions(-) -- 2.20.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/2] staging: sm750fb: Replace multiple spaces with tabs when it suits
Replace multiple spaces before some comments with one tab. Aligning the comment with the function below it. Signed-off-by: Gabriela Bittencourt --- drivers/staging/sm750fb/sm750_accel.c | 20 ++-- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/staging/sm750fb/sm750_accel.c b/drivers/staging/sm750fb/sm750_accel.c index 5925d7c7d464..8faa601c700b 100644 --- a/drivers/staging/sm750fb/sm750_accel.c +++ b/drivers/staging/sm750fb/sm750_accel.c @@ -243,21 +243,21 @@ int sm750_hw_copyarea(struct lynx_accel *accel, */ write_dpr(accel, DE_WINDOW_DESTINATION_BASE, dBase); /* dpr44 */ -/* - * Program pitch (distance between the 1st points of two adjacent lines). - * Note that input pitch is BYTE value, but the 2D Pitch register uses - * pixel values. Need Byte to pixel conversion. - */ + /* +* Program pitch (distance between the 1st points of two adjacent lines). +* Note that input pitch is BYTE value, but the 2D Pitch register uses +* pixel values. Need Byte to pixel conversion. +*/ write_dpr(accel, DE_PITCH, ((dPitch / Bpp << DE_PITCH_DESTINATION_SHIFT) & DE_PITCH_DESTINATION_MASK) | (sPitch / Bpp & DE_PITCH_SOURCE_MASK)); /* dpr10 */ -/* - * Screen Window width in Pixels. - * 2D engine uses this value to calculate the linear address in frame buffer - * for a given point. - */ + /* +* Screen Window width in Pixels. +* 2D engine uses this value to calculate the linear address in frame buffer +* for a given point. +*/ write_dpr(accel, DE_WINDOW_WIDTH, ((dPitch / Bpp << DE_WINDOW_WIDTH_DST_SHIFT) & DE_WINDOW_WIDTH_DST_MASK) | -- 2.20.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/2] staging: sm750fb: Fix typo in comment
Fixing typo in word 'and'. Signed-off-by: Gabriela Bittencourt --- drivers/staging/sm750fb/sm750_accel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/sm750fb/sm750_accel.c b/drivers/staging/sm750fb/sm750_accel.c index 645813a87490..5925d7c7d464 100644 --- a/drivers/staging/sm750fb/sm750_accel.c +++ b/drivers/staging/sm750fb/sm750_accel.c @@ -224,7 +224,7 @@ int sm750_hw_copyarea(struct lynx_accel *accel, /* * Note: -* DE_FOREGROUND are DE_BACKGROUND are don't care. +* DE_FOREGROUND and DE_BACKGROUND are don't care. * DE_COLOR_COMPARE and DE_COLOR_COMPARE_MAKS * are set by set deSetTransparency(). */ -- 2.20.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/6] staging: exfat: remove unnecessary parentheses
Fix checkpatch.pl warning: CHECK: Unnecessary parentheses around ... Signed-off-by: Roi Martin --- drivers/staging/exfat/exfat_core.c | 24 drivers/staging/exfat/exfat_super.c | 44 ++--- 2 files changed, 34 insertions(+), 34 deletions(-) diff --git a/drivers/staging/exfat/exfat_core.c b/drivers/staging/exfat/exfat_core.c index 79174e5c4145..d8f4fad732c4 100644 --- a/drivers/staging/exfat/exfat_core.c +++ b/drivers/staging/exfat/exfat_core.c @@ -550,7 +550,7 @@ s32 load_alloc_bitmap(struct super_block *sb) for (j = 0; j < p_fs->map_sectors; j++) { p_fs->vol_amap[j] = NULL; - ret = sector_read(sb, sector + j, &(p_fs->vol_amap[j]), 1); + ret = sector_read(sb, sector + j, &p_fs->vol_amap[j], 1); if (ret != FFS_SUCCESS) { /* release all buffers and free vol_amap */ i = 0; @@ -910,10 +910,10 @@ u32 fat_get_entry_type(struct dentry_t *p_entry) { struct dos_dentry_t *ep = (struct dos_dentry_t *)p_entry; - if (*(ep->name) == 0x0) + if (*ep->name == 0x0) return TYPE_UNUSED; - else if (*(ep->name) == 0xE5) + else if (*ep->name == 0xE5) return TYPE_DELETED; else if (ep->attr == ATTR_EXTEND) @@ -978,10 +978,10 @@ void fat_set_entry_type(struct dentry_t *p_entry, u32 type) struct dos_dentry_t *ep = (struct dos_dentry_t *)p_entry; if (type == TYPE_UNUSED) - *(ep->name) = 0x0; + *ep->name = 0x0; else if (type == TYPE_DELETED) - *(ep->name) = 0xE5; + *ep->name = 0xE5; else if (type == TYPE_EXTEND) ep->attr = ATTR_EXTEND; @@ -1562,7 +1562,7 @@ void update_dir_checksum_with_entry_set(struct super_block *sb, u16 chksum = 0; s32 chksum_type = CS_DIR_ENTRY, i; - ep = (struct dentry_t *)&(es->__buf); + ep = (struct dentry_t *)&es->__buf; for (i = 0; i < es->num_entries; i++) { pr_debug("%s ep %p\n", __func__, ep); chksum = calc_checksum_2byte((void *)ep, DENTRY_SIZE, chksum, @@ -1571,7 +1571,7 @@ void update_dir_checksum_with_entry_set(struct super_block *sb, chksum_type = CS_DEFAULT; } - ep = (struct dentry_t *)&(es->__buf); + ep = (struct dentry_t *)&es->__buf; SET16_A(((struct file_dentry_t *)ep)->checksum, chksum); write_whole_entry_set(sb, es); } @@ -1832,7 +1832,7 @@ struct entry_set_cache_t *get_entry_set_in_dir(struct super_block *sb, } if (file_ep) - *file_ep = (struct dentry_t *)&(es->__buf); + *file_ep = (struct dentry_t *)&es->__buf; pr_debug("%s exiting es %p sec %llu offset %d flags %d, num_entries %u buf ptr %p\n", __func__, es, (unsigned long long)es->sector, es->offset, @@ -1859,7 +1859,7 @@ static s32 __write_partial_entries_in_entry_set(struct super_block *sb, struct fs_info_t *p_fs = &(EXFAT_SB(sb)->fs_info); struct bd_info_t *p_bd = &(EXFAT_SB(sb)->bd_info); u32 clu; - u8 *buf, *esbuf = (u8 *)&(es->__buf); + u8 *buf, *esbuf = (u8 *)&es->__buf; pr_debug("%s entered es %p sec %llu off %d count %d\n", __func__, es, (unsigned long long)sec, off, count); @@ -1929,7 +1929,7 @@ s32 write_partial_entries_in_entry_set(struct super_block *sb, struct chain_t dir; /* vaidity check */ - if (ep + count > ((struct dentry_t *)&(es->__buf)) + es->num_entries) + if (ep + count > ((struct dentry_t *)&es->__buf) + es->num_entries) return FFS_ERROR; dir.dir = GET_CLUSTER_FROM_SECTOR(es->sector); @@ -1938,7 +1938,7 @@ s32 write_partial_entries_in_entry_set(struct super_block *sb, byte_offset = (es->sector - START_SECTOR(dir.dir)) << p_bd->sector_size_bits; - byte_offset += ((void **)ep - &(es->__buf)) + es->offset; + byte_offset += ((void **)ep - &es->__buf) + es->offset; ret = _walk_fat_chain(sb, &dir, byte_offset, &clu); if (ret != FFS_SUCCESS) @@ -2122,7 +2122,7 @@ s32 find_empty_entry(struct inode *inode, struct chain_t *p_dir, s32 num_entries p_fs->fs_func->set_entry_flag(ep, p_dir->flags); buf_modify(sb, sector); - update_dir_checksum(sb, &(fid->dir), + update_dir_checksum(sb, &fid->dir, fid->entry); } } diff --git a/drivers/staging/exfat/exfat_super.c b/drivers/staging/exfat/exfat_super.c index 3b
[PATCH 3/6] staging: exfat: remove unnecessary new line in if condition
Fix checkpatch.pl warning: CHECK: Logical continuations should be on the previous line Signed-off-by: Roi Martin --- drivers/staging/exfat/exfat_core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/staging/exfat/exfat_core.c b/drivers/staging/exfat/exfat_core.c index 177787296ab9..4d6ea5c809d3 100644 --- a/drivers/staging/exfat/exfat_core.c +++ b/drivers/staging/exfat/exfat_core.c @@ -1727,8 +1727,7 @@ struct entry_set_cache_t *get_entry_set_in_dir(struct super_block *sb, ep = (struct dentry_t *)(buf + off); entry_type = p_fs->fs_func->get_entry_type(ep); - if ((entry_type != TYPE_FILE) - && (entry_type != TYPE_DIR)) + if ((entry_type != TYPE_FILE) && (entry_type != TYPE_DIR)) goto err_out; if (type == ES_ALL_ENTRIES) -- 2.20.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 0/6] staging: exfat: fix multiple coding-style issues
Fix multiple coding-style issues reported by the checkpatch.pl script in the exfat module. Roi Martin (6): staging: exfat: remove unnecessary parentheses staging: exfat: make alignment match open parenthesis staging: exfat: remove unnecessary new line in if condition staging: exfat: replace printk(KERN_INFO ...) with pr_info() staging: exfat: avoid multiple assignments staging: exfat: replace kmalloc with kmalloc_array drivers/staging/exfat/exfat_core.c | 50 +- drivers/staging/exfat/exfat_super.c | 136 +++- 2 files changed, 119 insertions(+), 67 deletions(-) -- 2.20.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 5/6] staging: exfat: avoid multiple assignments
Fix checkpatch.pl warning: CHECK: multiple assignments should be avoided Signed-off-by: Roi Martin --- drivers/staging/exfat/exfat_core.c | 3 +- drivers/staging/exfat/exfat_super.c | 90 +++-- 2 files changed, 73 insertions(+), 20 deletions(-) diff --git a/drivers/staging/exfat/exfat_core.c b/drivers/staging/exfat/exfat_core.c index 4d6ea5c809d3..f446e6e6c4ee 100644 --- a/drivers/staging/exfat/exfat_core.c +++ b/drivers/staging/exfat/exfat_core.c @@ -470,7 +470,8 @@ s32 exfat_count_used_clusters(struct super_block *sb) struct fs_info_t *p_fs = &(EXFAT_SB(sb)->fs_info); struct bd_info_t *p_bd = &(EXFAT_SB(sb)->bd_info); - map_i = map_b = 0; + map_i = 0; + map_b = 0; for (i = 2; i < p_fs->num_clusters; i += 8) { k = *(((u8 *)p_fs->vol_amap[map_i]->b_data) + map_b); diff --git a/drivers/staging/exfat/exfat_super.c b/drivers/staging/exfat/exfat_super.c index 401f057fe924..278270a3cad6 100644 --- a/drivers/staging/exfat/exfat_super.c +++ b/drivers/staging/exfat/exfat_super.c @@ -864,7 +864,8 @@ static int ffsWriteFile(struct inode *inode, struct file_id_t *fid, while (count > 0) { clu_offset = (s32)(fid->rwoffset >> p_fs->cluster_size_bits); - clu = last_clu = fid->start_clu; + clu = fid->start_clu; + last_clu = fid->start_clu; if (fid->flags == 0x03) { if ((clu_offset > 0) && (clu != CLUSTER_32(~0))) { @@ -2351,6 +2352,7 @@ static int exfat_create(struct inode *dir, struct dentry *dentry, umode_t mode, bool excl) { struct super_block *sb = dir->i_sb; + struct timespec64 curtime; struct inode *inode; struct file_id_t fid; loff_t i_pos; @@ -2375,7 +2377,10 @@ static int exfat_create(struct inode *dir, struct dentry *dentry, umode_t mode, goto out; } INC_IVERSION(dir); - dir->i_ctime = dir->i_mtime = dir->i_atime = current_time(dir); + curtime = current_time(dir); + dir->i_ctime = curtime; + dir->i_mtime = curtime; + dir->i_atime = curtime; if (IS_DIRSYNC(dir)) (void)exfat_sync_inode(dir); else @@ -2389,7 +2394,10 @@ static int exfat_create(struct inode *dir, struct dentry *dentry, umode_t mode, goto out; } INC_IVERSION(inode); - inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); + curtime = current_time(inode); + inode->i_mtime = curtime; + inode->i_atime = curtime; + inode->i_ctime = curtime; /* * timestamp is already written, so mark_inode_dirty() is unnecessary. */ @@ -2522,6 +2530,7 @@ static int exfat_unlink(struct inode *dir, struct dentry *dentry) { struct inode *inode = dentry->d_inode; struct super_block *sb = dir->i_sb; + struct timespec64 curtime; int err; __lock_super(sb); @@ -2539,14 +2548,18 @@ static int exfat_unlink(struct inode *dir, struct dentry *dentry) goto out; } INC_IVERSION(dir); - dir->i_mtime = dir->i_atime = current_time(dir); + curtime = current_time(dir); + dir->i_mtime = curtime; + dir->i_atime = curtime; if (IS_DIRSYNC(dir)) (void)exfat_sync_inode(dir); else mark_inode_dirty(dir); clear_nlink(inode); - inode->i_mtime = inode->i_atime = current_time(inode); + curtime = current_time(inode); + inode->i_mtime = curtime; + inode->i_atime = curtime; exfat_detach(inode); remove_inode_hash(inode); @@ -2560,6 +2573,7 @@ static int exfat_symlink(struct inode *dir, struct dentry *dentry, const char *target) { struct super_block *sb = dir->i_sb; + struct timespec64 curtime; struct inode *inode; struct file_id_t fid; loff_t i_pos; @@ -2597,7 +2611,10 @@ static int exfat_symlink(struct inode *dir, struct dentry *dentry, } INC_IVERSION(dir); - dir->i_ctime = dir->i_mtime = dir->i_atime = current_time(dir); + curtime = current_time(dir); + dir->i_ctime = curtime; + dir->i_mtime = curtime; + dir->i_atime = curtime; if (IS_DIRSYNC(dir)) (void)exfat_sync_inode(dir); else @@ -2611,7 +2628,10 @@ static int exfat_symlink(struct inode *dir, struct dentry *dentry, goto out; } INC_IVERSION(inode); - inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode); + curtime = current_time(inode); + inode->i_mtime = curtime; + inode->i_atime = curtime; + inode->i_ctime = curtime; /* timestamp is already written, so mark_inode_dirty() is unneeded. */ EXFAT_I(inode)->target = kmemdup(target, len + 1, GFP_KERNEL
[PATCH 4/6] staging: exfat: replace printk(KERN_INFO ...) with pr_info()
Fix checkpatch.pl warning: WARNING: Prefer [subsystem eg: netdev]_info([subsystem]dev, ... then dev_info(dev, ... then pr_info(... to printk(KERN_INFO ... Signed-off-by: Roi Martin --- drivers/staging/exfat/exfat_super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/exfat/exfat_super.c b/drivers/staging/exfat/exfat_super.c index aa0d492fc673..401f057fe924 100644 --- a/drivers/staging/exfat/exfat_super.c +++ b/drivers/staging/exfat/exfat_super.c @@ -396,7 +396,7 @@ static int ffsMountVol(struct super_block *sb) if (i < 53) { #ifdef CONFIG_EXFAT_DONT_MOUNT_VFAT ret = -EINVAL; - printk(KERN_INFO "EXFAT: Attempted to mount VFAT filesystem\n"); + pr_info("EXFAT: Attempted to mount VFAT filesystem\n"); goto out; #else if (GET16(p_pbr->bpb + 11)) /* num_fat_sectors */ -- 2.20.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 6/6] staging: exfat: replace kmalloc with kmalloc_array
Replace expressions of the form: kmalloc(count * size, GFP_KERNEL); With: kmalloc_array(count, size, GFP_KERNEL); Signed-off-by: Roi Martin --- drivers/staging/exfat/exfat_core.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/staging/exfat/exfat_core.c b/drivers/staging/exfat/exfat_core.c index f446e6e6c4ee..a9391f0b8141 100644 --- a/drivers/staging/exfat/exfat_core.c +++ b/drivers/staging/exfat/exfat_core.c @@ -713,8 +713,8 @@ static s32 __load_upcase_table(struct super_block *sb, sector_t sector, u32 checksum = 0; - upcase_table = p_fs->vol_utbl = kmalloc(UTBL_COL_COUNT * sizeof(u16 *), - GFP_KERNEL); + upcase_table = kmalloc_array(UTBL_COL_COUNT, sizeof(u16 *), GFP_KERNEL); + p_fs->vol_utbl = upcase_table; if (!upcase_table) return FFS_MEMORYERR; memset(upcase_table, 0, UTBL_COL_COUNT * sizeof(u16 *)); @@ -793,8 +793,8 @@ static s32 __load_default_upcase_table(struct super_block *sb) u16 uni = 0; u16 **upcase_table; - upcase_table = p_fs->vol_utbl = kmalloc(UTBL_COL_COUNT * sizeof(u16 *), - GFP_KERNEL); + upcase_table = kmalloc_array(UTBL_COL_COUNT, sizeof(u16 *), GFP_KERNEL); + p_fs->vol_utbl = upcase_table; if (!upcase_table) return FFS_MEMORYERR; memset(upcase_table, 0, UTBL_COL_COUNT * sizeof(u16 *)); -- 2.20.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 2/6] staging: exfat: make alignment match open parenthesis
Fix checkpatch.pl warning: CHECK: Alignment should match open parenthesis Signed-off-by: Roi Martin --- drivers/staging/exfat/exfat_core.c | 12 ++-- 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/drivers/staging/exfat/exfat_core.c b/drivers/staging/exfat/exfat_core.c index d8f4fad732c4..177787296ab9 100644 --- a/drivers/staging/exfat/exfat_core.c +++ b/drivers/staging/exfat/exfat_core.c @@ -1703,7 +1703,7 @@ struct entry_set_cache_t *get_entry_set_in_dir(struct super_block *sb, size_t bufsize; pr_debug("%s entered p_dir dir %u flags %x size %d\n", - __func__, p_dir->dir, p_dir->flags, p_dir->size); +__func__, p_dir->dir, p_dir->flags, p_dir->size); byte_offset = entry << DENTRY_SIZE_BITS; ret = _walk_fat_chain(sb, p_dir, byte_offset, &clu); @@ -1835,8 +1835,8 @@ struct entry_set_cache_t *get_entry_set_in_dir(struct super_block *sb, *file_ep = (struct dentry_t *)&es->__buf; pr_debug("%s exiting es %p sec %llu offset %d flags %d, num_entries %u buf ptr %p\n", - __func__, es, (unsigned long long)es->sector, es->offset, - es->alloc_flag, es->num_entries, &es->__buf); +__func__, es, (unsigned long long)es->sector, es->offset, +es->alloc_flag, es->num_entries, &es->__buf); return es; err_out: pr_debug("%s exited NULL (es %p)\n", __func__, es); @@ -1862,7 +1862,7 @@ static s32 __write_partial_entries_in_entry_set(struct super_block *sb, u8 *buf, *esbuf = (u8 *)&es->__buf; pr_debug("%s entered es %p sec %llu off %d count %d\n", - __func__, es, (unsigned long long)sec, off, count); +__func__, es, (unsigned long long)sec, off, count); num_entries = count; while (num_entries) { @@ -1876,8 +1876,8 @@ static s32 __write_partial_entries_in_entry_set(struct super_block *sb, goto err_out; pr_debug("es->buf %p buf_off %u\n", esbuf, buf_off); pr_debug("copying %d entries from %p to sector %llu\n", - copy_entries, (esbuf + buf_off), - (unsigned long long)sec); +copy_entries, (esbuf + buf_off), +(unsigned long long)sec); memcpy(buf + off, esbuf + buf_off, copy_entries << DENTRY_SIZE_BITS); buf_modify(sb, sec); -- 2.20.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [Outreachy kernel] [PATCH 1/2] staging: sm750fb: Fix typo in comment
On Tue, 29 Oct 2019, Gabriela Bittencourt wrote: > Fixing typo in word 'and'. > > Signed-off-by: Gabriela Bittencourt Acked-by: Julia Lawall > --- > drivers/staging/sm750fb/sm750_accel.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/staging/sm750fb/sm750_accel.c > b/drivers/staging/sm750fb/sm750_accel.c > index 645813a87490..5925d7c7d464 100644 > --- a/drivers/staging/sm750fb/sm750_accel.c > +++ b/drivers/staging/sm750fb/sm750_accel.c > @@ -224,7 +224,7 @@ int sm750_hw_copyarea(struct lynx_accel *accel, > > /* >* Note: > - * DE_FOREGROUND are DE_BACKGROUND are don't care. > + * DE_FOREGROUND and DE_BACKGROUND are don't care. >* DE_COLOR_COMPARE and DE_COLOR_COMPARE_MAKS >* are set by set deSetTransparency(). >*/ > -- > 2.20.1 > > -- > You received this message because you are subscribed to the Google Groups > "outreachy-kernel" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to outreachy-kernel+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/outreachy-kernel/20191029232207.4113-2-gabrielabittencourt00%40gmail.com. > ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel