Skip to content

Commit db15538

Browse files
maquefeldamien-lemoal
authored andcommitted
ata: pata_ep93xx: use soc_device_match for UDMA modes
Replace ep93xx_chip_revision() with soc_device_match(), so ep93xx_chip_revision() can be safetly dropped from exported functions. Signed-off-by: Nikita Shubin <nikita.shubin@maquefel.me> Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru> Signed-off-by: Damien Le Moal <dlemoal@kernel.org>
1 parent 41203f9 commit db15538

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

drivers/ata/pata_ep93xx.c

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040
#include <linux/ata.h>
4141
#include <linux/libata.h>
4242
#include <linux/platform_device.h>
43+
#include <linux/sys_soc.h>
4344
#include <linux/delay.h>
4445
#include <linux/dmaengine.h>
4546
#include <linux/ktime.h>
@@ -910,6 +911,12 @@ static struct ata_port_operations ep93xx_pata_port_ops = {
910911
.port_start = ep93xx_pata_port_start,
911912
};
912913

914+
static const struct soc_device_attribute ep93xx_soc_table[] = {
915+
{ .revision = "E1", .data = (void *)ATA_UDMA3 },
916+
{ .revision = "E2", .data = (void *)ATA_UDMA4 },
917+
{ /* sentinel */ }
918+
};
919+
913920
static int ep93xx_pata_probe(struct platform_device *pdev)
914921
{
915922
struct ep93xx_pata_data *drv_data;
@@ -976,12 +983,11 @@ static int ep93xx_pata_probe(struct platform_device *pdev)
976983
* so this driver supports only UDMA modes.
977984
*/
978985
if (drv_data->dma_rx_channel && drv_data->dma_tx_channel) {
979-
int chip_rev = ep93xx_chip_revision();
986+
const struct soc_device_attribute *match;
980987

981-
if (chip_rev == EP93XX_CHIP_REV_E1)
982-
ap->udma_mask = ATA_UDMA3;
983-
else if (chip_rev == EP93XX_CHIP_REV_E2)
984-
ap->udma_mask = ATA_UDMA4;
988+
match = soc_device_match(ep93xx_soc_table);
989+
if (match)
990+
ap->udma_mask = (unsigned int) match->data;
985991
else
986992
ap->udma_mask = ATA_UDMA2;
987993
}

0 commit comments

Comments
 (0)