@@ -2125,19 +2125,16 @@ unsigned int ata_read_log_page(struct ata_device *dev, u8 log,
21252125
21262126static int ata_log_supported (struct ata_device * dev , u8 log )
21272127{
2128- struct ata_port * ap = dev -> link -> ap ;
2129-
21302128 if (dev -> quirks & ATA_QUIRK_NO_LOG_DIR )
21312129 return 0 ;
21322130
2133- if (ata_read_log_page (dev , ATA_LOG_DIRECTORY , 0 , ap -> sector_buf , 1 ))
2131+ if (ata_read_log_page (dev , ATA_LOG_DIRECTORY , 0 , dev -> sector_buf , 1 ))
21342132 return 0 ;
2135- return get_unaligned_le16 (& ap -> sector_buf [log * 2 ]);
2133+ return get_unaligned_le16 (& dev -> sector_buf [log * 2 ]);
21362134}
21372135
21382136static bool ata_identify_page_supported (struct ata_device * dev , u8 page )
21392137{
2140- struct ata_port * ap = dev -> link -> ap ;
21412138 unsigned int err , i ;
21422139
21432140 if (dev -> quirks & ATA_QUIRK_NO_ID_DEV_LOG )
@@ -2160,13 +2157,13 @@ static bool ata_identify_page_supported(struct ata_device *dev, u8 page)
21602157 * Read IDENTIFY DEVICE data log, page 0, to figure out if the page is
21612158 * supported.
21622159 */
2163- err = ata_read_log_page (dev , ATA_LOG_IDENTIFY_DEVICE , 0 , ap -> sector_buf ,
2164- 1 );
2160+ err = ata_read_log_page (dev , ATA_LOG_IDENTIFY_DEVICE , 0 ,
2161+ dev -> sector_buf , 1 );
21652162 if (err )
21662163 return false;
21672164
2168- for (i = 0 ; i < ap -> sector_buf [8 ]; i ++ ) {
2169- if (ap -> sector_buf [9 + i ] == page )
2165+ for (i = 0 ; i < dev -> sector_buf [8 ]; i ++ ) {
2166+ if (dev -> sector_buf [9 + i ] == page )
21702167 return true;
21712168 }
21722169
@@ -2218,20 +2215,19 @@ static inline bool ata_dev_knobble(struct ata_device *dev)
22182215
22192216static void ata_dev_config_ncq_send_recv (struct ata_device * dev )
22202217{
2221- struct ata_port * ap = dev -> link -> ap ;
22222218 unsigned int err_mask ;
22232219
22242220 if (!ata_log_supported (dev , ATA_LOG_NCQ_SEND_RECV )) {
22252221 ata_dev_warn (dev , "NCQ Send/Recv Log not supported\n" );
22262222 return ;
22272223 }
22282224 err_mask = ata_read_log_page (dev , ATA_LOG_NCQ_SEND_RECV ,
2229- 0 , ap -> sector_buf , 1 );
2225+ 0 , dev -> sector_buf , 1 );
22302226 if (!err_mask ) {
22312227 u8 * cmds = dev -> ncq_send_recv_cmds ;
22322228
22332229 dev -> flags |= ATA_DFLAG_NCQ_SEND_RECV ;
2234- memcpy (cmds , ap -> sector_buf , ATA_LOG_NCQ_SEND_RECV_SIZE );
2230+ memcpy (cmds , dev -> sector_buf , ATA_LOG_NCQ_SEND_RECV_SIZE );
22352231
22362232 if (dev -> quirks & ATA_QUIRK_NO_NCQ_TRIM ) {
22372233 ata_dev_dbg (dev , "disabling queued TRIM support\n" );
@@ -2243,7 +2239,6 @@ static void ata_dev_config_ncq_send_recv(struct ata_device *dev)
22432239
22442240static void ata_dev_config_ncq_non_data (struct ata_device * dev )
22452241{
2246- struct ata_port * ap = dev -> link -> ap ;
22472242 unsigned int err_mask ;
22482243
22492244 if (!ata_log_supported (dev , ATA_LOG_NCQ_NON_DATA )) {
@@ -2252,17 +2247,14 @@ static void ata_dev_config_ncq_non_data(struct ata_device *dev)
22522247 return ;
22532248 }
22542249 err_mask = ata_read_log_page (dev , ATA_LOG_NCQ_NON_DATA ,
2255- 0 , ap -> sector_buf , 1 );
2256- if (!err_mask ) {
2257- u8 * cmds = dev -> ncq_non_data_cmds ;
2258-
2259- memcpy (cmds , ap -> sector_buf , ATA_LOG_NCQ_NON_DATA_SIZE );
2260- }
2250+ 0 , dev -> sector_buf , 1 );
2251+ if (!err_mask )
2252+ memcpy (dev -> ncq_non_data_cmds , dev -> sector_buf ,
2253+ ATA_LOG_NCQ_NON_DATA_SIZE );
22612254}
22622255
22632256static void ata_dev_config_ncq_prio (struct ata_device * dev )
22642257{
2265- struct ata_port * ap = dev -> link -> ap ;
22662258 unsigned int err_mask ;
22672259
22682260 if (!ata_identify_page_supported (dev , ATA_LOG_SATA_SETTINGS ))
@@ -2271,12 +2263,11 @@ static void ata_dev_config_ncq_prio(struct ata_device *dev)
22712263 err_mask = ata_read_log_page (dev ,
22722264 ATA_LOG_IDENTIFY_DEVICE ,
22732265 ATA_LOG_SATA_SETTINGS ,
2274- ap -> sector_buf ,
2275- 1 );
2266+ dev -> sector_buf , 1 );
22762267 if (err_mask )
22772268 goto not_supported ;
22782269
2279- if (!(ap -> sector_buf [ATA_LOG_NCQ_PRIO_OFFSET ] & BIT (3 )))
2270+ if (!(dev -> sector_buf [ATA_LOG_NCQ_PRIO_OFFSET ] & BIT (3 )))
22802271 goto not_supported ;
22812272
22822273 dev -> flags |= ATA_DFLAG_NCQ_PRIO ;
@@ -2392,9 +2383,8 @@ static void ata_dev_config_sense_reporting(struct ata_device *dev)
23922383
23932384static void ata_dev_config_zac (struct ata_device * dev )
23942385{
2395- struct ata_port * ap = dev -> link -> ap ;
23962386 unsigned int err_mask ;
2397- u8 * identify_buf = ap -> sector_buf ;
2387+ u8 * identify_buf = dev -> sector_buf ;
23982388
23992389 dev -> zac_zones_optimal_open = U32_MAX ;
24002390 dev -> zac_zones_optimal_nonseq = U32_MAX ;
@@ -2446,7 +2436,6 @@ static void ata_dev_config_zac(struct ata_device *dev)
24462436
24472437static void ata_dev_config_trusted (struct ata_device * dev )
24482438{
2449- struct ata_port * ap = dev -> link -> ap ;
24502439 u64 trusted_cap ;
24512440 unsigned int err ;
24522441
@@ -2460,11 +2449,11 @@ static void ata_dev_config_trusted(struct ata_device *dev)
24602449 }
24612450
24622451 err = ata_read_log_page (dev , ATA_LOG_IDENTIFY_DEVICE , ATA_LOG_SECURITY ,
2463- ap -> sector_buf , 1 );
2452+ dev -> sector_buf , 1 );
24642453 if (err )
24652454 return ;
24662455
2467- trusted_cap = get_unaligned_le64 (& ap -> sector_buf [40 ]);
2456+ trusted_cap = get_unaligned_le64 (& dev -> sector_buf [40 ]);
24682457 if (!(trusted_cap & (1ULL << 63 ))) {
24692458 ata_dev_dbg (dev ,
24702459 "Trusted Computing capability qword not valid!\n" );
@@ -2492,12 +2481,12 @@ static void ata_dev_config_cdl(struct ata_device *dev)
24922481
24932482 err_mask = ata_read_log_page (dev , ATA_LOG_IDENTIFY_DEVICE ,
24942483 ATA_LOG_SUPPORTED_CAPABILITIES ,
2495- ap -> sector_buf , 1 );
2484+ dev -> sector_buf , 1 );
24962485 if (err_mask )
24972486 goto not_supported ;
24982487
24992488 /* Check Command Duration Limit Supported bits */
2500- val = get_unaligned_le64 (& ap -> sector_buf [168 ]);
2489+ val = get_unaligned_le64 (& dev -> sector_buf [168 ]);
25012490 if (!(val & BIT_ULL (63 )) || !(val & BIT_ULL (0 )))
25022491 goto not_supported ;
25032492
@@ -2510,7 +2499,7 @@ static void ata_dev_config_cdl(struct ata_device *dev)
25102499 * We must have support for the sense data for successful NCQ commands
25112500 * log indicated by the successful NCQ command sense data supported bit.
25122501 */
2513- val = get_unaligned_le64 (& ap -> sector_buf [8 ]);
2502+ val = get_unaligned_le64 (& dev -> sector_buf [8 ]);
25142503 if (!(val & BIT_ULL (63 )) || !(val & BIT_ULL (47 ))) {
25152504 ata_dev_warn (dev ,
25162505 "CDL supported but Successful NCQ Command Sense Data is not supported\n" );
@@ -2530,11 +2519,11 @@ static void ata_dev_config_cdl(struct ata_device *dev)
25302519 */
25312520 err_mask = ata_read_log_page (dev , ATA_LOG_IDENTIFY_DEVICE ,
25322521 ATA_LOG_CURRENT_SETTINGS ,
2533- ap -> sector_buf , 1 );
2522+ dev -> sector_buf , 1 );
25342523 if (err_mask )
25352524 goto not_supported ;
25362525
2537- val = get_unaligned_le64 (& ap -> sector_buf [8 ]);
2526+ val = get_unaligned_le64 (& dev -> sector_buf [8 ]);
25382527 cdl_enabled = val & BIT_ULL (63 ) && val & BIT_ULL (21 );
25392528 if (dev -> flags & ATA_DFLAG_CDL_ENABLED ) {
25402529 if (!cdl_enabled ) {
@@ -2591,13 +2580,13 @@ static void ata_dev_config_cdl(struct ata_device *dev)
25912580 * Command duration limits is supported: cache the CDL log page 18h
25922581 * (command duration descriptors).
25932582 */
2594- err_mask = ata_read_log_page (dev , ATA_LOG_CDL , 0 , ap -> sector_buf , 1 );
2583+ err_mask = ata_read_log_page (dev , ATA_LOG_CDL , 0 , dev -> sector_buf , 1 );
25952584 if (err_mask ) {
25962585 ata_dev_warn (dev , "Read Command Duration Limits log failed\n" );
25972586 goto not_supported ;
25982587 }
25992588
2600- memcpy (dev -> cdl , ap -> sector_buf , ATA_LOG_CDL_SIZE );
2589+ memcpy (dev -> cdl , dev -> sector_buf , ATA_LOG_CDL_SIZE );
26012590 dev -> flags |= ATA_DFLAG_CDL ;
26022591
26032592 return ;
@@ -2689,7 +2678,7 @@ static void ata_dev_config_fua(struct ata_device *dev)
26892678
26902679static void ata_dev_config_devslp (struct ata_device * dev )
26912680{
2692- u8 * sata_setting = dev -> link -> ap -> sector_buf ;
2681+ u8 * sata_setting = dev -> sector_buf ;
26932682 unsigned int err_mask ;
26942683 int i , j ;
26952684
@@ -3759,7 +3748,7 @@ static int ata_dev_same_device(struct ata_device *dev, unsigned int new_class,
37593748int ata_dev_reread_id (struct ata_device * dev , unsigned int readid_flags )
37603749{
37613750 unsigned int class = dev -> class ;
3762- u16 * id = (void * )dev -> link -> ap -> sector_buf ;
3751+ u16 * id = (void * )dev -> sector_buf ;
37633752 int rc ;
37643753
37653754 /* read ID data */
0 commit comments