[PATCH] staging: exfat: rename buf_cache_t's 'flag' to 'locked'
buf_cache_t.flag is used only for lock. Change the variable name from 'flag' to 'locked' and remove unused definitions. Reviewed-by: Takahiro Mori Signed-off-by: Tetsuhiro Kohada --- drivers/staging/exfat/exfat.h | 2 +- drivers/staging/exfat/exfat_cache.c | 27 --- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/drivers/staging/exfat/exfat.h b/drivers/staging/exfat/exfat.h index cd3479fc78ba..f588538c67a8 100644 --- a/drivers/staging/exfat/exfat.h +++ b/drivers/staging/exfat/exfat.h @@ -457,7 +457,7 @@ struct buf_cache_t { struct buf_cache_t *hash_prev; s32drv; sector_t sec; - u32 flag; + bool locked; struct buffer_head *buf_bh; }; diff --git a/drivers/staging/exfat/exfat_cache.c b/drivers/staging/exfat/exfat_cache.c index 87d019972050..b15203d4e0ae 100644 --- a/drivers/staging/exfat/exfat_cache.c +++ b/drivers/staging/exfat/exfat_cache.c @@ -8,9 +8,6 @@ #include #include "exfat.h" -#define LOCKBIT0x01 -#define DIRTYBIT 0x02 - /* Local variables */ static DEFINE_MUTEX(f_mutex); static DEFINE_MUTEX(b_mutex); @@ -141,7 +138,7 @@ void exfat_buf_init(struct super_block *sb) for (i = 0; i < FAT_CACHE_SIZE; i++) { p_fs->FAT_cache_array[i].drv = -1; p_fs->FAT_cache_array[i].sec = ~0; - p_fs->FAT_cache_array[i].flag = 0; + p_fs->FAT_cache_array[i].locked = false; p_fs->FAT_cache_array[i].buf_bh = NULL; p_fs->FAT_cache_array[i].prev = NULL; p_fs->FAT_cache_array[i].next = NULL; @@ -155,7 +152,7 @@ void exfat_buf_init(struct super_block *sb) for (i = 0; i < BUF_CACHE_SIZE; i++) { p_fs->buf_cache_array[i].drv = -1; p_fs->buf_cache_array[i].sec = ~0; - p_fs->buf_cache_array[i].flag = 0; + p_fs->buf_cache_array[i].locked = false; p_fs->buf_cache_array[i].buf_bh = NULL; p_fs->buf_cache_array[i].prev = NULL; p_fs->buf_cache_array[i].next = NULL; @@ -289,7 +286,7 @@ u8 *exfat_fat_getblk(struct super_block *sb, sector_t sec) bp->drv = p_fs->drv; bp->sec = sec; - bp->flag = 0; + bp->locked = false; FAT_cache_insert_hash(sb, bp); @@ -297,7 +294,7 @@ u8 *exfat_fat_getblk(struct super_block *sb, sector_t sec) FAT_cache_remove_hash(bp); bp->drv = -1; bp->sec = ~0; - bp->flag = 0; + bp->locked = false; bp->buf_bh = NULL; move_to_lru(bp, &p_fs->FAT_cache_lru_list); @@ -328,7 +325,7 @@ void exfat_fat_release_all(struct super_block *sb) if (bp->drv == p_fs->drv) { bp->drv = -1; bp->sec = ~0; - bp->flag = 0; + bp->locked = false; if (bp->buf_bh) { __brelse(bp->buf_bh); @@ -366,7 +363,7 @@ static struct buf_cache_t *buf_cache_get(struct super_block *sb, sector_t sec) struct fs_info_t *p_fs = &(EXFAT_SB(sb)->fs_info); bp = p_fs->buf_cache_lru_list.prev; - while (bp->flag & LOCKBIT) + while (bp->locked) bp = bp->prev; move_to_mru(bp, &p_fs->buf_cache_lru_list); @@ -390,7 +387,7 @@ static u8 *__exfat_buf_getblk(struct super_block *sb, sector_t sec) bp->drv = p_fs->drv; bp->sec = sec; - bp->flag = 0; + bp->locked = false; buf_cache_insert_hash(sb, bp); @@ -398,7 +395,7 @@ static u8 *__exfat_buf_getblk(struct super_block *sb, sector_t sec) buf_cache_remove_hash(bp); bp->drv = -1; bp->sec = ~0; - bp->flag = 0; + bp->locked = false; bp->buf_bh = NULL; move_to_lru(bp, &p_fs->buf_cache_lru_list); @@ -443,7 +440,7 @@ void exfat_buf_lock(struct super_block *sb, sector_t sec) bp = buf_cache_find(sb, sec); if (likely(bp)) - bp->flag |= LOCKBIT; + bp->locked = true; WARN(!bp, "[EXFAT] failed to find buffer_cache(sector:%llu).\n", (unsigned long long)sec); @@ -459,7 +456,7 @@ void exfat_buf_unlock(struct super_block *sb, sector_t sec) bp = buf_cache_find(sb, sec); if (likely(bp)) - bp->flag &= ~(LOCKBIT); + bp->locked = false; WARN(!bp, "[EXFAT] failed to find buffer_cache(sector:%llu).\n", (unsigned long long)sec); @@ -478,7 +475,7 @@ void exfat_buf_release(struct super_block *sb, sector_t sec) if (likely(bp)) { bp->drv = -1; bp->sec = ~0; - bp->flag = 0; + bp->locked = false; if (bp->buf_bh) {
[PATCH] staging: kpc2000: kpc2000_spi: Use new structure for SPI transfer delays
In a recent change to the SPI subsystem [1], a new `delay` struct was added to replace the `delay_usecs`. This change replaces the current `delay_usecs` with `delay` for this driver. The `spi_transfer_delay_exec()` function [in the SPI framework] makes sure that both `delay_usecs` & `delay` are used (in this order to preserve backwards compatibility). [1] commit bebcfd272df6 ("spi: introduce `delay` field for `spi_transfer` + spi_transfer_delay_exec()") Signed-off-by: Sergiu Cuciurean --- drivers/staging/kpc2000/kpc2000_spi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/staging/kpc2000/kpc2000_spi.c b/drivers/staging/kpc2000/kpc2000_spi.c index 1c360daa703d..cc9b147fd437 100644 --- a/drivers/staging/kpc2000/kpc2000_spi.c +++ b/drivers/staging/kpc2000/kpc2000_spi.c @@ -386,8 +386,9 @@ kp_spi_transfer_one_message(struct spi_master *master, struct spi_message *m) } } - if (transfer->delay_usecs) - udelay(transfer->delay_usecs); + if (transfer->delay.value && + (transfer->delay.unit == SPI_DELAY_UNIT_USECS)) + udelay(transfer->delay.value); } /* de-assert chip select to end the sequence */ -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: wilc1000: spi: Use new structure for SPI transfer delays
In a recent change to the SPI subsystem [1], a new `delay` struct was added to replace the `delay_usecs`. This change replaces the current `delay_usecs` with `delay` for this driver. The `spi_transfer_delay_exec()` function [in the SPI framework] makes sure that both `delay_usecs` & `delay` are used (in this order to preserve backwards compatibility). [1] commit bebcfd272df6 ("spi: introduce `delay` field for `spi_transfer` + spi_transfer_delay_exec()") Signed-off-by: Sergiu Cuciurean --- drivers/staging/wilc1000/spi.c | 15 --- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/drivers/staging/wilc1000/spi.c b/drivers/staging/wilc1000/spi.c index 11653ac118cd..a3779d967a24 100644 --- a/drivers/staging/wilc1000/spi.c +++ b/drivers/staging/wilc1000/spi.c @@ -228,7 +228,10 @@ static int wilc_spi_tx(struct wilc *wilc, u8 *b, u32 len) struct spi_transfer tr = { .tx_buf = b, .len = len, - .delay_usecs = 0, + .delay = { + .value = 0, + .unit = SPI_DELAY_UNIT_USECS + }, }; char *r_buffer = kzalloc(len, GFP_KERNEL); @@ -269,7 +272,10 @@ static int wilc_spi_rx(struct wilc *wilc, u8 *rb, u32 rlen) struct spi_transfer tr = { .rx_buf = rb, .len = rlen, - .delay_usecs = 0, + .delay = { + .value = 0, + .unit = SPI_DELAY_UNIT_USECS + }, }; char *t_buffer = kzalloc(rlen, GFP_KERNEL); @@ -311,7 +317,10 @@ static int wilc_spi_tx_rx(struct wilc *wilc, u8 *wb, u8 *rb, u32 rlen) .tx_buf = wb, .len = rlen, .bits_per_word = 8, - .delay_usecs = 0, + .delay = { + .value = 0, + .unit = SPI_DELAY_UNIT_USECS + }, }; -- 2.17.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v1] media: staging: tegra-vde: Use devm_platform_ioremap_resource_byname()
This helps to make code cleaner a tad. Signed-off-by: Dmitry Osipenko --- drivers/staging/media/tegra-vde/vde.c | 55 +-- 1 file changed, 9 insertions(+), 46 deletions(-) diff --git a/drivers/staging/media/tegra-vde/vde.c b/drivers/staging/media/tegra-vde/vde.c index e18fd48981da..d3e63512a765 100644 --- a/drivers/staging/media/tegra-vde/vde.c +++ b/drivers/staging/media/tegra-vde/vde.c @@ -949,7 +949,6 @@ static int tegra_vde_runtime_resume(struct device *dev) static int tegra_vde_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; - struct resource *regs; struct tegra_vde *vde; int irq, err; @@ -959,75 +958,39 @@ static int tegra_vde_probe(struct platform_device *pdev) platform_set_drvdata(pdev, vde); - regs = platform_get_resource_byname(pdev, IORESOURCE_MEM, "sxe"); - if (!regs) - return -ENODEV; - - vde->sxe = devm_ioremap_resource(dev, regs); + vde->sxe = devm_platform_ioremap_resource_byname(pdev, "sxe"); if (IS_ERR(vde->sxe)) return PTR_ERR(vde->sxe); - regs = platform_get_resource_byname(pdev, IORESOURCE_MEM, "bsev"); - if (!regs) - return -ENODEV; - - vde->bsev = devm_ioremap_resource(dev, regs); + vde->bsev = devm_platform_ioremap_resource_byname(pdev, "bsev"); if (IS_ERR(vde->bsev)) return PTR_ERR(vde->bsev); - regs = platform_get_resource_byname(pdev, IORESOURCE_MEM, "mbe"); - if (!regs) - return -ENODEV; - - vde->mbe = devm_ioremap_resource(dev, regs); + vde->mbe = devm_platform_ioremap_resource_byname(pdev, "mbe"); if (IS_ERR(vde->mbe)) return PTR_ERR(vde->mbe); - regs = platform_get_resource_byname(pdev, IORESOURCE_MEM, "ppe"); - if (!regs) - return -ENODEV; - - vde->ppe = devm_ioremap_resource(dev, regs); + vde->ppe = devm_platform_ioremap_resource_byname(pdev, "ppe"); if (IS_ERR(vde->ppe)) return PTR_ERR(vde->ppe); - regs = platform_get_resource_byname(pdev, IORESOURCE_MEM, "mce"); - if (!regs) - return -ENODEV; - - vde->mce = devm_ioremap_resource(dev, regs); + vde->mce = devm_platform_ioremap_resource_byname(pdev, "mce"); if (IS_ERR(vde->mce)) return PTR_ERR(vde->mce); - regs = platform_get_resource_byname(pdev, IORESOURCE_MEM, "tfe"); - if (!regs) - return -ENODEV; - - vde->tfe = devm_ioremap_resource(dev, regs); + vde->tfe = devm_platform_ioremap_resource_byname(pdev, "tfe"); if (IS_ERR(vde->tfe)) return PTR_ERR(vde->tfe); - regs = platform_get_resource_byname(pdev, IORESOURCE_MEM, "ppb"); - if (!regs) - return -ENODEV; - - vde->ppb = devm_ioremap_resource(dev, regs); + vde->ppb = devm_platform_ioremap_resource_byname(pdev, "ppb"); if (IS_ERR(vde->ppb)) return PTR_ERR(vde->ppb); - regs = platform_get_resource_byname(pdev, IORESOURCE_MEM, "vdma"); - if (!regs) - return -ENODEV; - - vde->vdma = devm_ioremap_resource(dev, regs); + vde->vdma = devm_platform_ioremap_resource_byname(pdev, "vdma"); if (IS_ERR(vde->vdma)) return PTR_ERR(vde->vdma); - regs = platform_get_resource_byname(pdev, IORESOURCE_MEM, "frameid"); - if (!regs) - return -ENODEV; - - vde->frameid = devm_ioremap_resource(dev, regs); + vde->frameid = devm_platform_ioremap_resource_byname(pdev, "frameid"); if (IS_ERR(vde->frameid)) return PTR_ERR(vde->frameid); -- 2.24.0 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: vt6656: Use mac80211 duration for tx headers
mac80211 already provides the correct duration simply copy it to the tx headers removing the need for driver to find it with vnt_get_duration_le. Signed-off-by: Malcolm Priestley --- drivers/staging/vt6656/rxtx.c | 57 +-- 1 file changed, 8 insertions(+), 49 deletions(-) diff --git a/drivers/staging/vt6656/rxtx.c b/drivers/staging/vt6656/rxtx.c index 74c1062dbaaa..1003808ac4ad 100644 --- a/drivers/staging/vt6656/rxtx.c +++ b/drivers/staging/vt6656/rxtx.c @@ -13,7 +13,6 @@ * * Functions: * vnt_generate_tx_parameter - Generate tx dma required parameter. - * vnt_get_duration_le - get tx data required duration * vnt_get_rtscts_duration_le- get rtx/cts required duration * vnt_get_rtscts_rsvtime_le- get rts/cts reserved time * vnt_get_rsvtime- get frame reserved time @@ -166,27 +165,6 @@ static __le16 vnt_get_rtscts_rsvtime_le(struct vnt_private *priv, u8 rsv_type, return cpu_to_le16((u16)rrv_time); } -static __le16 vnt_get_duration_le(struct vnt_private *priv, u8 pkt_type, - int need_ack) -{ - u32 ack_time = 0; - - if (need_ack) { - if (pkt_type == PK_TYPE_11B) - ack_time = vnt_get_frame_time(priv->preamble_type, - pkt_type, 14, - priv->top_cck_basic_rate); - else - ack_time = vnt_get_frame_time(priv->preamble_type, - pkt_type, 14, - priv->top_ofdm_basic_rate); - - return cpu_to_le16((u16)(priv->sifs + ack_time)); - } - - return 0; -} - static __le16 vnt_get_rtscts_duration_le(struct vnt_usb_send_context *context, u8 dur_type, u8 pkt_type, u16 rate) { @@ -246,7 +224,6 @@ static u16 vnt_rxtx_datahead_g(struct vnt_usb_send_context *tx_context, (struct ieee80211_hdr *)tx_context->skb->data; u32 frame_len = tx_context->frame_len; u16 rate = tx_context->tx_rate; - u8 need_ack = tx_context->need_ack; /* Get SignalField,ServiceField,Length */ vnt_get_phy_field(priv, frame_len, rate, tx_context->pkt_type, &buf->a); @@ -254,16 +231,8 @@ static u16 vnt_rxtx_datahead_g(struct vnt_usb_send_context *tx_context, PK_TYPE_11B, &buf->b); /* Get Duration and TimeStamp */ - if (ieee80211_is_nullfunc(hdr->frame_control)) { - buf->duration_a = hdr->duration_id; - buf->duration_b = hdr->duration_id; - } else { - buf->duration_a = vnt_get_duration_le(priv, - tx_context->pkt_type, need_ack); - buf->duration_b = vnt_get_duration_le(priv, - PK_TYPE_11B, need_ack); - } - + buf->duration_a = hdr->duration_id; + buf->duration_b = hdr->duration_id; buf->time_stamp_off_a = vnt_time_stamp_off(priv, rate); buf->time_stamp_off_b = vnt_time_stamp_off(priv, priv->top_cck_basic_rate); @@ -281,20 +250,13 @@ static u16 vnt_rxtx_datahead_ab(struct vnt_usb_send_context *tx_context, (struct ieee80211_hdr *)tx_context->skb->data; u32 frame_len = tx_context->frame_len; u16 rate = tx_context->tx_rate; - u8 need_ack = tx_context->need_ack; /* Get SignalField,ServiceField,Length */ vnt_get_phy_field(priv, frame_len, rate, tx_context->pkt_type, &buf->ab); /* Get Duration and TimeStampOff */ - if (ieee80211_is_nullfunc(hdr->frame_control)) { - buf->duration = hdr->duration_id; - } else { - buf->duration = vnt_get_duration_le(priv, tx_context->pkt_type, - need_ack); - } - + buf->duration = hdr->duration_id; buf->time_stamp_off = vnt_time_stamp_off(priv, rate); tx_context->tx_hdr_size = vnt_mac_hdr_pos(tx_context, &buf->hdr); @@ -721,8 +683,6 @@ int vnt_tx_packet(struct vnt_private *priv, struct sk_buff *skb) memcpy(tx_context->hdr, skb->data, tx_body_size); - hdr->duration_id = cpu_to_le16(duration_id); - if (info->control.hw_key) { tx_key = info->control.hw_key; if (tx_key->keylen > 0) @@ -788,9 +748,7 @@ static int vnt_beacon_xmit(struct vnt_private *priv, struct sk_buff *skb) vnt_get_phy_field(priv, frame_size, current_rate, PK_TYPE_11A, &short_head->ab); - /* Get Duration and TimeStampOff */ - short_head->duration = vnt_get_duration_le(priv, -
[PATCH] Staging: exfat: fixed a long line coding style issue
Fixed a coding style issue Signed-off-by: Vivek M --- drivers/staging/exfat/exfat_blkdev.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/staging/exfat/exfat_blkdev.c b/drivers/staging/exfat/exfat_blkdev.c index 0a3dc35..ddff019 100644 --- a/drivers/staging/exfat/exfat_blkdev.c +++ b/drivers/staging/exfat/exfat_blkdev.c @@ -30,8 +30,9 @@ void exfat_bdev_close(struct super_block *sb) p_bd->opened = false; } -int exfat_bdev_read(struct super_block *sb, sector_t secno, struct buffer_head **bh, - u32 num_secs, bool read) +int exfat_bdev_read(struct super_block *sb, sector_t secno, + struct buffer_head **bh, u32 num_secs, + bool read) { struct bd_info_t *p_bd = &(EXFAT_SB(sb)->bd_info); struct fs_info_t *p_fs = &(EXFAT_SB(sb)->fs_info); @@ -65,7 +66,8 @@ int exfat_bdev_read(struct super_block *sb, sector_t secno, struct buffer_head * return -EIO; } -int exfat_bdev_write(struct super_block *sb, sector_t secno, struct buffer_head *bh, +int exfat_bdev_write(struct super_block *sb, sector_t secno, +struct buffer_head *bh, u32 num_secs, bool sync) { s32 count; -- 2.7.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel