SD library mod for SPI_QUARTER_SPEED

Hello,
I don't know if anyone else faced this problem, but recent I came across an SD card that only works with SPI quarter speed... (had to use the QuickStart example of the SdFat library to figure that out).
I did not notice any method in the SD library to change the SPI speed. It can be achieved by a little modification in the library.

In SD.h file, replace

boolean begin(uint8_t csPin = SD_CHIP_SELECT_PIN);

with

boolean begin(uint8_t csPin = SD_CHIP_SELECT_PIN, uint8_t spiSpeed = SPI_HALF_SPEED);

and in SD.cpp file,replace

boolean SDClass::begin(uint8_t csPin) {
  /*

    Performs the initialisation required by the sdfatlib library.

    Return true if initialization succeeds, false otherwise.

   */
  return card.init(SPI_HALF_SPEED, csPin) &&
         volume.init(card) &&
         root.openRoot(volume);
}

with

boolean SDClass::begin(uint8_t csPin, uint8_t spiSpeed) {
  /*

    Performs the initialisation required by the sdfatlib library.

    Return true if initialization succeeds, false otherwise.

   */
  return card.init(spiSpeed, csPin) &&
         volume.init(card) &&
         root.openRoot(volume);
}

After these modifications any of the following methods can be used to start the SD object.

SD.begin();
SD.begin(cspin);
SD.begin(cspin, spiSpeed);

spiSpeed (which is optional) can be SPI_FULL_SPEED, SPI_HALF_SPEED or SPI_QUARTER_SPEED as supported by SD2Card class.

Hope this helps.

I have a problem with a SD micro module with LS 125 chip on a PCB board. I use Arduino IDE version 1.8 with a SD library by a Sparkfun dated at 2010 inside a code. I found a solution here as to write SPI_QUARTER_SPEED into card init for example:
SD.begin()
if (!card.init(SPI_QUARTER_SPEED, chipSelect))
I am not shure that this works and a library was updated because I cannot find such a keyword inside a SD.h. Can anyone tell me how to test this to be shure that it works?
Or maybe I ought to make a correction to a SD code ezplained above?

the post U read was 5 yrs old. Libraries are updated. New documentation can be found