File tree Expand file tree Collapse file tree 3 files changed +11
-9
lines changed Expand file tree Collapse file tree 3 files changed +11
-9
lines changed Original file line number Diff line number Diff line change @@ -380,8 +380,7 @@ int tpm1_get_timeouts(struct tpm_chip *chip)
380
380
* of misreporting.
381
381
*/
382
382
if (chip -> ops -> update_timeouts )
383
- chip -> timeout_adjusted =
384
- chip -> ops -> update_timeouts (chip , timeout_eff );
383
+ chip -> ops -> update_timeouts (chip , timeout_eff );
385
384
386
385
if (!chip -> timeout_adjusted ) {
387
386
/* Restore default if chip reported 0 */
Original file line number Diff line number Diff line change @@ -521,35 +521,38 @@ static const struct tis_vendor_timeout_override vendor_timeout_overrides[] = {
521
521
(TIS_SHORT_TIMEOUT * 1000 ), (TIS_SHORT_TIMEOUT * 1000 ) } },
522
522
};
523
523
524
- static bool tpm_tis_update_timeouts (struct tpm_chip * chip ,
524
+ static void tpm_tis_update_timeouts (struct tpm_chip * chip ,
525
525
unsigned long * timeout_cap )
526
526
{
527
527
struct tpm_tis_data * priv = dev_get_drvdata (& chip -> dev );
528
528
int i , rc ;
529
529
u32 did_vid ;
530
530
531
+ chip -> timeout_adjusted = false;
532
+
531
533
if (chip -> ops -> clk_enable != NULL )
532
534
chip -> ops -> clk_enable (chip , true);
533
535
534
536
rc = tpm_tis_read32 (priv , TPM_DID_VID (0 ), & did_vid );
535
- if (rc < 0 )
537
+ if (rc < 0 ) {
538
+ dev_warn (& chip -> dev , "%s: failed to read did_vid: %d\n" ,
539
+ __func__ , rc );
536
540
goto out ;
541
+ }
537
542
538
543
for (i = 0 ; i != ARRAY_SIZE (vendor_timeout_overrides ); i ++ ) {
539
544
if (vendor_timeout_overrides [i ].did_vid != did_vid )
540
545
continue ;
541
546
memcpy (timeout_cap , vendor_timeout_overrides [i ].timeout_us ,
542
547
sizeof (vendor_timeout_overrides [i ].timeout_us ));
543
- rc = true;
548
+ chip -> timeout_adjusted = true;
544
549
}
545
550
546
- rc = false;
547
-
548
551
out :
549
552
if (chip -> ops -> clk_enable != NULL )
550
553
chip -> ops -> clk_enable (chip , false);
551
554
552
- return rc ;
555
+ return ;
553
556
}
554
557
555
558
/*
Original file line number Diff line number Diff line change @@ -41,7 +41,7 @@ struct tpm_class_ops {
41
41
int (* send ) (struct tpm_chip * chip , u8 * buf , size_t len );
42
42
void (* cancel ) (struct tpm_chip * chip );
43
43
u8 (* status ) (struct tpm_chip * chip );
44
- bool (* update_timeouts )(struct tpm_chip * chip ,
44
+ void (* update_timeouts )(struct tpm_chip * chip ,
45
45
unsigned long * timeout_cap );
46
46
int (* go_idle )(struct tpm_chip * chip );
47
47
int (* cmd_ready )(struct tpm_chip * chip );
You can’t perform that action at this time.
0 commit comments