diff options
| -rw-r--r-- | drivers/ata/ahci_da850.c | 8 | ||||
| -rw-r--r-- | drivers/ata/libata-core.c | 3 | ||||
| -rw-r--r-- | include/linux/ata.h | 10 |
3 files changed, 18 insertions, 3 deletions
diff --git a/drivers/ata/ahci_da850.c b/drivers/ata/ahci_da850.c index 1a50cd3b4233..9b34dff64536 100644 --- a/drivers/ata/ahci_da850.c +++ b/drivers/ata/ahci_da850.c | |||
| @@ -216,12 +216,16 @@ static int ahci_da850_probe(struct platform_device *pdev) | |||
| 216 | return rc; | 216 | return rc; |
| 217 | 217 | ||
| 218 | res = platform_get_resource(pdev, IORESOURCE_MEM, 1); | 218 | res = platform_get_resource(pdev, IORESOURCE_MEM, 1); |
| 219 | if (!res) | 219 | if (!res) { |
| 220 | rc = -ENODEV; | ||
| 220 | goto disable_resources; | 221 | goto disable_resources; |
| 222 | } | ||
| 221 | 223 | ||
| 222 | pwrdn_reg = devm_ioremap(dev, res->start, resource_size(res)); | 224 | pwrdn_reg = devm_ioremap(dev, res->start, resource_size(res)); |
| 223 | if (!pwrdn_reg) | 225 | if (!pwrdn_reg) { |
| 226 | rc = -ENOMEM; | ||
| 224 | goto disable_resources; | 227 | goto disable_resources; |
| 228 | } | ||
| 225 | 229 | ||
| 226 | da850_sata_init(dev, pwrdn_reg, hpriv->mmio, mpy); | 230 | da850_sata_init(dev, pwrdn_reg, hpriv->mmio, mpy); |
| 227 | 231 | ||
diff --git a/drivers/ata/libata-core.c b/drivers/ata/libata-core.c index fa7dd4394c02..1945a8ea2099 100644 --- a/drivers/ata/libata-core.c +++ b/drivers/ata/libata-core.c | |||
| @@ -2411,6 +2411,9 @@ static void ata_dev_config_trusted(struct ata_device *dev) | |||
| 2411 | u64 trusted_cap; | 2411 | u64 trusted_cap; |
| 2412 | unsigned int err; | 2412 | unsigned int err; |
| 2413 | 2413 | ||
| 2414 | if (!ata_id_has_trusted(dev->id)) | ||
| 2415 | return; | ||
| 2416 | |||
| 2414 | if (!ata_identify_page_supported(dev, ATA_LOG_SECURITY)) { | 2417 | if (!ata_identify_page_supported(dev, ATA_LOG_SECURITY)) { |
| 2415 | ata_dev_warn(dev, | 2418 | ata_dev_warn(dev, |
| 2416 | "Security Log not supported\n"); | 2419 | "Security Log not supported\n"); |
diff --git a/include/linux/ata.h b/include/linux/ata.h index e65ae4b2ed48..c7a353825450 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h | |||
| @@ -60,7 +60,8 @@ enum { | |||
| 60 | ATA_ID_FW_REV = 23, | 60 | ATA_ID_FW_REV = 23, |
| 61 | ATA_ID_PROD = 27, | 61 | ATA_ID_PROD = 27, |
| 62 | ATA_ID_MAX_MULTSECT = 47, | 62 | ATA_ID_MAX_MULTSECT = 47, |
| 63 | ATA_ID_DWORD_IO = 48, | 63 | ATA_ID_DWORD_IO = 48, /* before ATA-8 */ |
| 64 | ATA_ID_TRUSTED = 48, /* ATA-8 and later */ | ||
| 64 | ATA_ID_CAPABILITY = 49, | 65 | ATA_ID_CAPABILITY = 49, |
| 65 | ATA_ID_OLD_PIO_MODES = 51, | 66 | ATA_ID_OLD_PIO_MODES = 51, |
| 66 | ATA_ID_OLD_DMA_MODES = 52, | 67 | ATA_ID_OLD_DMA_MODES = 52, |
| @@ -889,6 +890,13 @@ static inline bool ata_id_has_dword_io(const u16 *id) | |||
| 889 | return id[ATA_ID_DWORD_IO] & (1 << 0); | 890 | return id[ATA_ID_DWORD_IO] & (1 << 0); |
| 890 | } | 891 | } |
| 891 | 892 | ||
| 893 | static inline bool ata_id_has_trusted(const u16 *id) | ||
| 894 | { | ||
| 895 | if (ata_id_major_version(id) <= 7) | ||
| 896 | return false; | ||
| 897 | return id[ATA_ID_TRUSTED] & (1 << 0); | ||
| 898 | } | ||
| 899 | |||
| 892 | static inline bool ata_id_has_unload(const u16 *id) | 900 | static inline bool ata_id_has_unload(const u16 *id) |
| 893 | { | 901 | { |
| 894 | if (ata_id_major_version(id) >= 7 && | 902 | if (ata_id_major_version(id) >= 7 && |
